mirror of https://github.com/embarklabs/embark.git
clear noise from demo generation
This commit is contained in:
parent
a4b6752482
commit
87f1e01dd9
|
@ -1,6 +1,5 @@
|
||||||
/*jshint esversion: 6, loopfunc: true */
|
/*jshint esversion: 6, loopfunc: true */
|
||||||
var fs = require('fs');
|
var fs = require('fs');
|
||||||
var grunt = require('grunt');
|
|
||||||
var mkdirp = require('mkdirp');
|
var mkdirp = require('mkdirp');
|
||||||
|
|
||||||
var Pipeline = function(options) {
|
var Pipeline = function(options) {
|
||||||
|
|
|
@ -4,7 +4,9 @@ var path = require('path');
|
||||||
var wrench = require('wrench');
|
var wrench = require('wrench');
|
||||||
|
|
||||||
var run = function(cmd) {
|
var run = function(cmd) {
|
||||||
if (exec(cmd).code !== 0) {
|
var result = exec(cmd, {silent: true});
|
||||||
|
if (result.code !== 0) {
|
||||||
|
console.log(result.stderr);
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -15,13 +17,25 @@ var TemplateGenerator = function(templateName) {
|
||||||
|
|
||||||
TemplateGenerator.prototype.generate = function(destinationFolder, name) {
|
TemplateGenerator.prototype.generate = function(destinationFolder, name) {
|
||||||
var templatePath = path.join(__dirname, '/../', this.templateName);
|
var templatePath = path.join(__dirname, '/../', this.templateName);
|
||||||
|
console.log('Initializing Embark Template....'.green);
|
||||||
|
|
||||||
wrench.copyDirSyncRecursive(templatePath, destinationFolder + name);
|
wrench.copyDirSyncRecursive(templatePath, destinationFolder + name);
|
||||||
|
|
||||||
cd(destinationFolder + name);
|
cd(destinationFolder + name);
|
||||||
|
|
||||||
|
console.log('Installing packages.. this can take a few seconds'.green);
|
||||||
run('npm install');
|
run('npm install');
|
||||||
console.log('\n\ninit complete'.green);
|
console.log('Init complete'.green);
|
||||||
console.log('\n\app ready at '.green + destinationFolder + name);
|
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;
|
module.exports = TemplateGenerator;
|
||||||
|
|
Loading…
Reference in New Issue