|
|
|
|
|
|
|
|
// PB : TODO -- processedArgs should already be part of selected. |
|
|
// PB : TODO -- processedArgs should already be part of selected. |
|
|
var instanceName = processedArgs._[1] = processedArgs._[1] || chessinstances.current_run.instanceName || selected.instanceName; |
|
|
var instanceName = processedArgs._[1] = processedArgs._[1] || chessinstances.current_run.instanceName || selected.instanceName; |
|
|
var node_env = processedArgs.node_env = processedArgs.node_env || chessinstances.current_run.node_env || selected.node_env; |
|
|
var node_env = processedArgs.node_env = processedArgs.node_env || chessinstances.current_run.node_env || selected.node_env; |
|
|
|
|
|
chessinstances[instanceName] = chessinstances[instanceName] || {} |
|
|
|
|
|
chessinstances[instanceName][node_env] = chessinstances[instanceName][node_env] || selected; |
|
|
chessinstances['current_run'] = chessinstances[instanceName][selected.node_env] ? |
|
|
chessinstances['current_run'] = chessinstances[instanceName][selected.node_env] ? |
|
|
{ instanceName: instanceName, node_env: node_env } : chessinstances['current_run'] |
|
|
|
|
|
// chessinstances[chessinstances.current_run.instanceName] = chessinstances[chessinstances.current_run.instanceName] || {} |
|
|
|
|
|
|
|
|
{ instanceName: instanceName, node_env: node_env } : (chessinstances['current_run'] || { instanceName: instanceName, node_env: node_env }) |
|
|
|
|
|
|
|
|
|
|
|
// chessinstances[chessinstances.current_run.instanceName] = chessinstances[chessinstances.current_run.instanceName] || {} |
|
|
|
|
|
|
|
|
if(path.normalize(selected.root) !== path.normalize(chessinstances[instanceName][node_env].root)) { |
|
|
if(path.normalize(selected.root) !== path.normalize(chessinstances[instanceName][node_env].root)) { |
|
|
throw "Mismatched chessinstances config found " + chessinstances[instanceName][node_env].root + ' does not match ' + selected.root |
|
|
throw "Mismatched chessinstances config found " + chessinstances[instanceName][node_env].root + ' does not match ' + selected.root |