support both meteor and grunt config files

This commit is contained in:
Iuri Matias 2015-07-07 07:17:13 -04:00
parent 9a4e62072f
commit 1f03a4e962
1 changed files with 14 additions and 14 deletions

View File

@ -6,6 +6,7 @@ var wrench = require('wrench');
var grunt = require('grunt');
require('shelljs/global');
var readYaml = require('read-yaml');
var Embark = require('embark-framework');
var run = function(cmd) {
if (exec(cmd).code != 0) {
@ -30,23 +31,22 @@ program.command('new [name]').description('New application').action(function(nam
console.log('\n\ninit complete');
});
program.command('meteor [env]').description('experimental meteor cmd').action(function(env_) {
program.command('deploy [env]').description('deploy contracts').action(function(env_) {
var env = env_ || 'development';
var embarkConfig = readYaml.sync("./embark.yml");
if (embarkConfig.type === "grunt") {
run("grunt deploy_contracts:" + env);
}
else {
contractFiles = grunt.file.expand(embarkConfig.contracts);
destFile = embarkConfig.output
Embark = require('embark-framework')
Embark.init()
Embark.blockchainConfig.loadConfigFile(embarkConfig.blockchainConfig)
Embark.contractsConfig.loadConfigFile(embarkConfig.contractsConfig)
abi = Embark.deployContracts(env, contractFiles, destFile)
grunt.file.write(destFile, abi);
});
program.command('deploy [env]').description('deploy contracts').action(function(env_) {
var env = env_ || 'development';
run("grunt deploy_contracts:" + env);
}
});
program.command('build [env]').description('build dapp').action(function(env_) {