Skip to content

Commit c9cece5

Browse files
authored
Move logs to error handler
1 parent 0f8e08e commit c9cece5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/create-react-app/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,6 @@ function install(useYarn, dependencies, verbose, isOnline) {
179179
var child = spawn(command, args, {stdio: 'inherit'});
180180
child.on('close', function(code) {
181181
if (code !== 0) {
182-
console.log();
183-
console.error('Aborting installation.', chalk.cyan(command + ' ' + args.join(' ')), 'has failed.');
184182
reject();
185183
return;
186184
}
@@ -226,6 +224,9 @@ function run(root, appName, version, verbose, originalDirectory, template) {
226224
init(root, appName, verbose, originalDirectory, template);
227225
})
228226
.catch(function() {
227+
console.log();
228+
console.error('Aborting installation.', chalk.cyan(command + ' ' + args.join(' ')), 'has failed.');
229+
229230
// On 'exit' we will delete these files from target directory.
230231
var knownGeneratedFiles = [
231232
'package.json', 'npm-debug.log', 'yarn-error.log', 'yarn-debug.log', 'node_modules'

0 commit comments

Comments
 (0)