take into account other type of cmds

This commit is contained in:
Iuri Matias 2015-07-09 23:05:34 -04:00
parent d55f31f64b
commit 1fef23a14c
1 changed files with 45 additions and 10 deletions

View File

@ -51,31 +51,66 @@ program.command('deploy [env]').description('deploy contracts').action(function(
program.command('build [env]').description('build dapp').action(function(env_) {
var env = env_ || 'development';
run("grunt clean");
run("grunt deploy_contracts:" + env);
run('grunt build:' + env);
var embarkConfig = readYaml.sync("./embark.yml");
if (embarkConfig.type === "grunt") {
run("grunt clean");
run("grunt deploy_contracts:" + env);
run('grunt build:' + env);
}
});
program.command('ipfs [env]').description('build dapp and make it available in ipfs').action(function(env_) {
var env = env_ || 'development';
run("grunt clean")
run("grunt deploy_contracts:" + env)
run('grunt build:' + env)
run('grunt ipfs:' + env)
var embarkConfig = readYaml.sync("./embark.yml");
if (embarkConfig.type === "grunt") {
run("grunt clean")
run("grunt deploy_contracts:" + env)
run('grunt build:' + env)
run('grunt ipfs:' + env)
}
else {
console.log("command not available in meteor or manual mode yet");
}
});
program.command('run [env]').description('run dapp').action(function(env_) {
var env = env_ || 'development';
run('grunt deploy:' + env);
var embarkConfig = readYaml.sync("./embark.yml");
if (embarkConfig.type === "grunt") {
run('grunt deploy:' + env);
}
else {
console.log("command not available in meteor or manual mode yet");
}
});
program.command('spec').description('run specs').action(function() {
run('jasmine');
var embarkConfig = readYaml.sync("./embark.yml");
if (embarkConfig.type === "grunt") {
run('jasmine');
}
else {
console.log("command not available in meteor or manual mode yet");
}
});
program.command('blockchain [env]').description('run blockchain').action(function(env_) {
var env = env_ || 'development';
run('grunt blockchain:' + env);
var embarkConfig = readYaml.sync("./embark.yml");
if (embarkConfig.type === "grunt") {
run('grunt blockchain:' + env);
}
else {
Embark.init()
Embark.blockchainConfig.loadConfigFile(embarkConfig.blockchainConfig)
Embark.contractsConfig.loadConfigFile(embarkConfig.contractsConfig)
Embark.startBlockchain(env);
}
});
program.command('demo').description('create a working dapp with a SimpleStorage contract').action(function() {