diff --git a/lib/pipeline.js b/lib/pipeline.js index a917c13b2..11ab55169 100644 --- a/lib/pipeline.js +++ b/lib/pipeline.js @@ -1,6 +1,5 @@ /*jshint esversion: 6, loopfunc: true */ var fs = require('fs'); -var grunt = require('grunt'); var mkdirp = require('mkdirp'); var Pipeline = function(options) { diff --git a/lib/template_generator.js b/lib/template_generator.js index 3cee1ee77..d7784d3bd 100644 --- a/lib/template_generator.js +++ b/lib/template_generator.js @@ -4,7 +4,9 @@ var path = require('path'); var wrench = require('wrench'); var run = function(cmd) { - if (exec(cmd).code !== 0) { + var result = exec(cmd, {silent: true}); + if (result.code !== 0) { + console.log(result.stderr); exit(); } }; @@ -15,13 +17,25 @@ var TemplateGenerator = function(templateName) { TemplateGenerator.prototype.generate = function(destinationFolder, name) { var templatePath = path.join(__dirname, '/../', this.templateName); + console.log('Initializing Embark Template....'.green); wrench.copyDirSyncRecursive(templatePath, destinationFolder + name); - cd(destinationFolder + name); + + console.log('Installing packages.. this can take a few seconds'.green); run('npm install'); - console.log('\n\ninit complete'.green); - console.log('\n\app ready at '.green + destinationFolder + name); + console.log('Init complete'.green); + console.log('\nApp ready at '.green + destinationFolder + name); + + if (name === 'embark_demo') { + console.log('-------------------'.yellow); + console.log('next steps:'.green); + console.log(('-> cd ' + destinationFolder + name).green); + console.log('-> embark blockchain or embark simulator'.green); + console.log('open another console in the same directory and run'.green); + console.log('-> embark run'.green); + console.log('For more info go to http://github.com/iurimatias/embark-framework'.green); + } }; module.exports = TemplateGenerator;