From 9a5c3906cd6aae89b5a0b5ecb8ff8a9ba918e4ea Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Tue, 14 Jul 2015 20:58:08 -0400 Subject: [PATCH] update meteor commands --- bin/embark | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/bin/embark b/bin/embark index a370d9b7c..67f9c6ac1 100644 --- a/bin/embark +++ b/bin/embark @@ -14,6 +14,16 @@ var run = function(cmd) { } } +var deploy = fnction(embarkConfig) { + contractFiles = grunt.file.expand(embarkConfig.contracts); + destFile = embarkConfig.output + Embark.init() + Embark.blockchainConfig.loadConfigFile(embarkConfig.blockchainConfig) + Embark.contractsConfig.loadConfigFile(embarkConfig.contractsConfig) + abi = Embark.deployContracts(env, contractFiles, destFile) + grunt.file.write(destFile, abi); +} + program .version('0.6.0') @@ -39,13 +49,7 @@ program.command('deploy [env]').description('deploy contracts').action(function( run("grunt deploy_contracts:" + env); } else { - contractFiles = grunt.file.expand(embarkConfig.contracts); - destFile = embarkConfig.output - Embark.init() - Embark.blockchainConfig.loadConfigFile(embarkConfig.blockchainConfig) - Embark.contractsConfig.loadConfigFile(embarkConfig.contractsConfig) - abi = Embark.deployContracts(env, contractFiles, destFile) - grunt.file.write(destFile, abi); + deploy(); } }); @@ -59,7 +63,7 @@ program.command('build [env]').description('build dapp').action(function(env_) { run('grunt build:' + env); } else if (embarkConfig.type === "meteor") { - //deploy + deploy(); run("meteor-build-client ./build -p ''"); } }); @@ -75,9 +79,8 @@ program.command('ipfs [env]').description('build dapp and make it available in i run('grunt ipfs:' + env) } else if (embarkConfig.type === "meteor") { - //deploy - //build - Embark = require('embark-framework') + deploy(); + run("meteor-build-client ./build -p ''"); Embark.release.ipfs("build/") } else { @@ -106,6 +109,7 @@ program.command('spec').description('run specs').action(function() { } else { console.log("command not available in meteor or manual mode yet"); + console.log("note: you can use embark tests with any framework"); } });