We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ad0d874 commit 52c0cfbCopy full SHA for 52c0cfb
addon/ng2/tasks/git-init.js
@@ -30,6 +30,19 @@ module.exports = Task.extend({
30
31
return exec('git --version')
32
.then(function () {
33
+ // check if we're inside a git repo
34
+ return exec('git rev-parse --is-inside-work-tree')
35
+ .then(function () {
36
+ return true;
37
+ })
38
+ .catch(function() {
39
+ return false;
40
41
42
+ .then(function (insideGitRepo) {
43
+ if (insideGitRepo) {
44
+ return ui.writeLine('Directory is already under version control. Skipping initialization of git.');
45
+ }
46
return exec('git init')
47
48
return exec('git add .');
0 commit comments