don't log "Next steps" messages until `npm install` has finished

This commit is contained in:
Michael Bradley, Jr 2018-09-27 14:56:33 -05:00 committed by Pascal Precht
parent 585e286adb
commit aa87614a98
No known key found for this signature in database
GPG Key ID: 0EE28D8D6FD85D7D
1 changed files with 12 additions and 10 deletions

View File

@ -61,9 +61,8 @@ class TemplateGenerator {
this.installTemplate(
fspath,
name,
(this.templateName === 'boilerplate' || this.templateName === 'demo')
);
(this.templateName === 'boilerplate' || this.templateName === 'demo'),
() => {
if (name === 'embark_demo') {
console.log('-------------------'.yellow);
console.log(__('Next steps:').green);
@ -72,8 +71,10 @@ class TemplateGenerator {
console.log(__('For more info go to http://embark.status.im').green);
}
}
);
}
installTemplate(templatePath, name, installPackages) {
installTemplate(templatePath, name, installPackages, cb) {
utils.cd(templatePath);
utils.sed('package.json', '%APP_NAME%', name);
if (fs.existsSync('dot.gitignore')) {
@ -93,6 +94,7 @@ class TemplateGenerator {
}
console.log(__('Init complete').green);
console.log('\n' + __('App ready at ').green + templatePath);
if (cb) cb();
});
}
}