Pārlūkot izejas kodu

Fixes for root detection

master
guest pirms 2 gadiem
vecāks
revīzija
82615dbd93
1 mainītis faili ar 18 papildinājumiem un 11 dzēšanām
  1. 18
    11
      index.js

+ 18
- 11
index.js Parādīt failu

@@ -115,7 +115,7 @@ const existsFolderSync = existsSync;
const fs = require('fs')

const cliargs = utils.cliargs;
const processedArgs = cliargs(process.argv);
const processedArgs = cliargs(process.argv.slice(2));
if(!processedArgs.wd){
if(process.env.wd){
@@ -2162,8 +2162,8 @@ var elxrcmd = (function(){
function __createO(o){
if(o.finalized) return o;
var subs = Object.keys(cmds[o.cmd].subcommands || {})
console.log(subs)
console.log(o)
// console.log(subs)
// console.log(o)
subs.forEach(sub=>elxrcmd.create( cmds[subcommandlabelFor(o.cmd, sub)] ))
var created = utils.assign_strict({}, __cmd, cmds[o.cmd], o)
@@ -2786,7 +2786,11 @@ while(parent !== pp){
}

var instanceroot = null
var detectInstanceRoot = any(instancediscoverytasks, true, true).then( ir => instanceroot = ir.pVal ).catch(()=>{
var detectInstanceRoot = any(instancediscoverytasks, true, true).then( ir => {
if(ir.error) { instanceroot = path.normalize(thisscriptdir) === path.normalize(launchpath) ? path.normalize(thisscriptdir + '/..') : launchpath ; }
else instanceroot = ir.pVal
return instanceroot
}).catch(()=>{
instanceroot = path.normalize(thisscriptdir) === path.normalize(launchpath) ? path.normalize(thisscriptdir + '/..') : launchpath ;
})

@@ -3969,7 +3973,7 @@ var generateDependencies = function(){
// alert(objENV('wd'))
// PB : TODO -- Convert all the cli args back to string.
// __filename will sure we are launhed using the same entry point.
var cargs = (processedArgs.debug ? '--inspect-brk=9228' : '') + ' ${path.basename(__filename)} ' + processedArgs._.join(' ') + ' ' + namedArgs.join(' ');
var cargs = (processedArgs.debug ? '--inspect-brk=9228' : '') + ' ${__filename.replace(/\\/g, '\\\\')} ' + processedArgs._.join(' ') + ' ' + namedArgs.join(' ');
// alert(cargs)
var shell = new ActiveXObject('shell.application');
// alert('launching node privilged. ' + processedArgs['nodepath'])
@@ -4103,7 +4107,8 @@ var startElxr = function() {
else collect.push(matches[1])
}
}, `${selectedinstance.root}/.elxr` ).then(()=>{
}, `${selectedinstance.root}/.elxr` )
.then(()=>{
// delete garbage
if(collect.length > retaincount) {
@@ -4115,15 +4120,17 @@ var startElxr = function() {
}
else return true
})
.then(()=>{
if (!skipprerequisites && !__isElevated || processedArgs.forceprereqs && !__isElevated ) mainTasks.push(verifyAndInstallPrerequisites);
mainTasks.push(maintask)
return any(mainTasks);
})
}
else {
if (!skipprerequisites && !__isElevated || processedArgs.forceprereqs && !__isElevated ) mainTasks.push(verifyAndInstallPrerequisites);
mainTasks.push(maintask)
return any(mainTasks);
}
else return true;
})
.then(()=>{
})
}


Notiek ielāde…
Atcelt
Saglabāt