add demo task

This commit is contained in:
Iuri Matias 2015-05-24 09:21:08 -04:00
parent 8d1ebe9ba0
commit 1d6a741847
1 changed files with 13 additions and 0 deletions

View File

@ -44,6 +44,19 @@ program.command('blockchain [env]').description('run blockchain').action(functio
exec('grunt blockchain:' + env);
});
program.command('demo').description('create a working dapp with a SimpleStorage contract').action(function() {
var boilerPath = path.join(__dirname + '/../boilerplate');
var demoPath = path.join(__dirname + '/../demo');
var targetDir = "./embark_demo";
wrench.copyDirSyncRecursive(boilerPath, targetDir);
wrench.copyDirSyncRecursive(demoPath, targetDir + "/app", {forceDelete: true});
cd(targetDir);
exec('npm install');
console.log('\n\ninit complete');
});
program.parse(process.argv)
if (!process.argv.slice(2).length) {