@@ -51,31 +51,66 @@ program.command('deploy [env]').description('deploy contracts').action(function(
5151
5252program . command ( 'build [env]' ) . description ( 'build dapp' ) . action ( function ( env_ ) {
5353 var env = env_ || 'development' ;
54- run ( "grunt clean" ) ;
55- run ( "grunt deploy_contracts:" + env ) ;
56- run ( 'grunt build:' + env ) ;
54+ var embarkConfig = readYaml . sync ( "./embark.yml" ) ;
55+
56+ if ( embarkConfig . type === "grunt" ) {
57+ run ( "grunt clean" ) ;
58+ run ( "grunt deploy_contracts:" + env ) ;
59+ run ( 'grunt build:' + env ) ;
60+ }
5761} ) ;
5862
5963program . command ( 'ipfs [env]' ) . description ( 'build dapp and make it available in ipfs' ) . action ( function ( env_ ) {
6064 var env = env_ || 'development' ;
61- run ( "grunt clean" )
62- run ( "grunt deploy_contracts:" + env )
63- run ( 'grunt build:' + env )
64- run ( 'grunt ipfs:' + env )
65+ var embarkConfig = readYaml . sync ( "./embark.yml" ) ;
66+
67+ if ( embarkConfig . type === "grunt" ) {
68+ run ( "grunt clean" )
69+ run ( "grunt deploy_contracts:" + env )
70+ run ( 'grunt build:' + env )
71+ run ( 'grunt ipfs:' + env )
72+ }
73+ else {
74+ console . log ( "command not available in meteor or manual mode yet" ) ;
75+ }
6576} ) ;
6677
6778program . command ( 'run [env]' ) . description ( 'run dapp' ) . action ( function ( env_ ) {
6879 var env = env_ || 'development' ;
69- run ( 'grunt deploy:' + env ) ;
80+ var embarkConfig = readYaml . sync ( "./embark.yml" ) ;
81+
82+ if ( embarkConfig . type === "grunt" ) {
83+ run ( 'grunt deploy:' + env ) ;
84+ }
85+ else {
86+ console . log ( "command not available in meteor or manual mode yet" ) ;
87+ }
7088} ) ;
7189
7290program . command ( 'spec' ) . description ( 'run specs' ) . action ( function ( ) {
73- run ( 'jasmine' ) ;
91+ var embarkConfig = readYaml . sync ( "./embark.yml" ) ;
92+
93+ if ( embarkConfig . type === "grunt" ) {
94+ run ( 'jasmine' ) ;
95+ }
96+ else {
97+ console . log ( "command not available in meteor or manual mode yet" ) ;
98+ }
7499} ) ;
75100
76101program . command ( 'blockchain [env]' ) . description ( 'run blockchain' ) . action ( function ( env_ ) {
77102 var env = env_ || 'development' ;
78- run ( 'grunt blockchain:' + env ) ;
103+ var embarkConfig = readYaml . sync ( "./embark.yml" ) ;
104+
105+ if ( embarkConfig . type === "grunt" ) {
106+ run ( 'grunt blockchain:' + env ) ;
107+ }
108+ else {
109+ Embark . init ( )
110+ Embark . blockchainConfig . loadConfigFile ( embarkConfig . blockchainConfig )
111+ Embark . contractsConfig . loadConfigFile ( embarkConfig . contractsConfig )
112+ Embark . startBlockchain ( env ) ;
113+ }
79114} ) ;
80115
81116program . command ( 'demo' ) . description ( 'create a working dapp with a SimpleStorage contract' ) . action ( function ( ) {
0 commit comments