@@ -36,7 +36,6 @@ def build(environment, network, config, provenance_branch=None, version=None, ar
3636 version = provenance_branch
3737 branches = utils .get_remote_branches ()
3838 repo = git .Repo (provenance_path )
39- print (branches )
4039 try :
4140 if provenance_branch in branches :
4241 repo .git .checkout (provenance_branch )
@@ -229,22 +228,27 @@ def spawnDaemon(node_command, version, network, config, log_path):
229228
230229
231230def start_node (node_command , version , network , config , log_path ):
232- log = open (log_path , 'w+' )
233- print ('Running {}' .format ('' .join (node_command )))
234- print ('You can view the logs here: {}' .format (log_path ))
235- process = subprocess .Popen (
236- node_command , shell = False , stdout = log , stderr = log )
237- if network == 'localnet' :
238- config [network ][version ]['run-command' ] = node_command
239- config [network ][version ]['log-path' ] = log_path
240- else :
241- config [network ]['run-command' ] = node_command
242- config [network ]['log-path' ] = log_path
243- config ['running-node' ] = True
244- config ['running-node-info' ] = {
245- "pid" : process .pid ,
246- "version" : version ,
247- "network" : network
248- }
249- utils .save_config (config )
250- process .wait ()
231+ try :
232+ log = open (log_path , 'w+' )
233+ print ('Running {}' .format (' ' .join (node_command )))
234+ print ('You can view the logs here: {}' .format (log_path ))
235+ process = subprocess .Popen (
236+ node_command , shell = False , stdout = log , stderr = log )
237+ if network == 'localnet' :
238+ config [network ][version ]['run-command' ] = node_command
239+ config [network ][version ]['log-path' ] = log_path
240+ else :
241+ config [network ]['run-command' ] = node_command
242+ config [network ]['log-path' ] = log_path
243+ config ['running-node' ] = True
244+ config ['running-node-info' ] = {
245+ "pid" : process .pid ,
246+ "version" : version ,
247+ "network" : network
248+ }
249+ utils .save_config (config )
250+ process .wait ()
251+ except FileNotFoundError :
252+ print ("It looks like a node was initialized and deleted.\n Forge is removing this from the config so you can run the same command again and the node will be initialized and started." .format ())
253+ config .pop (network )
254+ utils .save_config (config )
0 commit comments