Skip to content

Commit

Permalink
Move logs to error handler
Browse files Browse the repository at this point in the history
  • Loading branch information
gaearon authored Feb 28, 2017
1 parent 0f8e08e commit c9cece5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/create-react-app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,6 @@ function install(useYarn, dependencies, verbose, isOnline) {
var child = spawn(command, args, {stdio: 'inherit'});
child.on('close', function(code) {
if (code !== 0) {
console.log();
console.error('Aborting installation.', chalk.cyan(command + ' ' + args.join(' ')), 'has failed.');
reject();
return;
}
Expand Down Expand Up @@ -226,6 +224,9 @@ function run(root, appName, version, verbose, originalDirectory, template) {
init(root, appName, verbose, originalDirectory, template);
})
.catch(function() {
console.log();
console.error('Aborting installation.', chalk.cyan(command + ' ' + args.join(' ')), 'has failed.');

// On 'exit' we will delete these files from target directory.
var knownGeneratedFiles = [
'package.json', 'npm-debug.log', 'yarn-error.log', 'yarn-debug.log', 'node_modules'
Expand Down

0 comments on commit c9cece5

Please sign in to comment.