clear noise from demo generation

This commit is contained in:
Iuri Matias 2017-01-13 19:17:29 -05:00
parent a4b6752482
commit 87f1e01dd9
2 changed files with 18 additions and 5 deletions

View File

@ -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) {

View File

@ -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;