Skip to content
Prev Previous commit
Next Next commit
Create repo after installing react and react-dom
  • Loading branch information
mauricedb committed Feb 27, 2017
commit e61343f485e619dacba177e0ae109b2dafffec29
10 changes: 5 additions & 5 deletions packages/react-scripts/scripts/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function gitInit() {

execSync('git init', {stdio: 'ignore'});
execSync('git add .', {stdio: 'ignore'});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be git add -A?
(infact git add . covers create and update but this one feels more inclusive)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sendilkumarn Sure, no problem but there really is no difference. Using git add -A is the same as git add . with Git 2. With Git 1 it isn't the same but the difference is in deleted files. As this is a newly created repo there is not going to be any deleted files.

execSync('git commit -m "initial commit from create-react-app"', {stdio: 'ignore'});
execSync('git commit -m "Initial commit from create-react-app"', {stdio: 'ignore'});

return true;
} catch (e) {
Expand Down Expand Up @@ -101,10 +101,6 @@ module.exports = function(appPath, appName, verbose, originalDirectory, template
}
});

if (gitInit()) {
console.log('Initializing git repository');
}

var command;
var args;

Expand Down Expand Up @@ -145,6 +141,10 @@ module.exports = function(appPath, appName, verbose, originalDirectory, template
}
}

if (gitInit()) {
console.log('Initializing git repository');

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is done after git initialized so i guess it's better to say git repository initialized rather than initializing

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

}

// Display the most elegant way to cd.
// This needs to handle an undefined originalDirectory for
// backward compatibility with old global-cli's.
Expand Down