瀏覽代碼

Fixed legacy instance code.

master
pb 2 年之前
父節點
當前提交
a44862578c
共有 1 個文件被更改,包括 12 次插入9 次删除
  1. 12
    9
      index.js

+ 12
- 9
index.js 查看文件

@@ -2309,7 +2309,7 @@ shell_verse.acquireElevationState().then((isElevated) => {
var localinstancesPath = `${instanceroot}/${p}.elxr`;
if(existsSync( localinstancesPath )) {
try {
var chessinstances = acquirelocalinstances( `${instanceroot}/${p}` )
var chessinstances = acquirelocalinstances( { root : `${instanceroot}/${p}` } )
if(chessinstances.error) delete chessinstances.error
return Object.keys(chessinstances).earlyreduce( ( reduced, instanceName) => {
return Object.keys(chessinstances[instanceName]).earlyreduce( (reduced, instanceType) => {
@@ -2349,13 +2349,16 @@ shell_verse.acquireElevationState().then((isElevated) => {
}

var cacheWriteInstanceConfig = function(chessinstances, instanceroot, selectedinstance){
var instanceName = selectedinstance.instanceName ;
var node_env = selectedinstance.node_env;
// PB : TODO -- handle current_run switch...
// console.dir(chessinstances)
// PB : TODO -- We should be able to do simply merge at a higher level using assign
chessinstances[instanceName][node_env].repos = mergeObjByKey(chessinstances[instanceName][node_env].repos || [], 'repo') ;
chessinstances[instanceName][node_env].elevated = mergeObjByKey(chessinstances[instanceName][node_env].elevated || [], 'repo') ;
if(selectedinstance) {

var instanceName = selectedinstance.instanceName ;
var node_env = selectedinstance.node_env;
// PB : TODO -- handle current_run switch...
// console.dir(chessinstances)
// PB : TODO -- We should be able to do simply merge at a higher level using assign
chessinstances[instanceName][node_env].repos = mergeObjByKey(chessinstances[instanceName][node_env].repos || [], 'repo') ;
chessinstances[instanceName][node_env].elevated = mergeObjByKey(chessinstances[instanceName][node_env].elevated || [], 'repo') ;
}
fs.writeFileSync(instanceroot + '/chessinstances.js', 'module.exports = ' + JSON.stringify(chessinstances, null, 2) + '', { 'flag': 'w' })
}

@@ -3600,7 +3603,7 @@ shell_verse.acquireElevationState().then((isElevated) => {
, selected, selectedinstance)
chessinstances[selected.instanceName][selected.node_env].reposervers = Array.from(new Set(chessinstances[selected.instanceName][selected.node_env].reposervers))
selectedinstance.reposerver = selectedinstance.reposerver || selectedinstance.reposervers[0] // PB : TODO -- Attempt first one that is available and online...
cacheWriteInstanceConfig(chessinstances, selectedinstance.root)
cacheWriteInstanceConfig(chessinstances, selectedinstance.root, selectedinstance)
// ENV.NODE_ENV = selectedinstance.node_env;
throw e
}

Loading…
取消
儲存