Skip to content

Commit

Permalink
add logs to debug windows
Browse files Browse the repository at this point in the history
  • Loading branch information
gaearon authored Jan 21, 2018
1 parent 7f8e93a commit 2a4b18c
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions packages/react-scripts/scripts/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ const os = require('os');

function insideGitRepository() {
try {
execSync('git rev-parse --is-inside-work-tree', { stdio: 'ignore' });
console.log('will detect');
execSync('git rev-parse --is-inside-work-tree');
return true;
} catch (e) {
return false;
Expand All @@ -42,17 +43,19 @@ function insideMercurialRepository() {

function tryGitInit() {
try {
execSync('git --version', { stdio: 'ignore' });
console.log('will check');
execSync('git --version');

if (insideGitRepository() || insideMercurialRepository()) {
return false;
}

execSync('git init', { stdio: 'ignore' });
execSync('git add -A', { stdio: 'ignore' });
execSync('git commit -m "Initial commit from Create React App"', {
stdio: 'ignore',
});
console.log('will init');
execSync('git init');
console.log('will add');
execSync('git add -A');
console.log('will commit');
execSync('git commit -m "Initial commit from Create React App"');

return true;
} catch (e) {
Expand Down

0 comments on commit 2a4b18c

Please sign in to comment.