/node_modules | |||||
/node_modules | |||||
/.elxr | |||||
package-lock.json |
var ENV = Object.assign({}, process.env); // Shallow clone it. | var ENV = Object.assign({}, process.env); // Shallow clone it. | ||||
const spawn = require('child_process').spawn; | const spawn = require('child_process').spawn; | ||||
console.dir(process.argv.slice(2)) | |||||
const child = spawn( | const child = spawn( | ||||
(process.platform === 'win32' ? 'npm.cmd' : 'npm') | (process.platform === 'win32' ? 'npm.cmd' : 'npm') | ||||
, ['run', 'index'].concat(process.argv.slice(2)), { cwd: __dirname }); | |||||
, ['run', 'index', '--'].concat(process.argv.slice(2)), { cwd: __dirname }); | |||||
// const child = spawn( | // const child = spawn( | ||||
// 'C:\\Program Files\\Git\\bin\\sh.exe' | // 'C:\\Program Files\\Git\\bin\\sh.exe' |
var args = Array.from(arguments); | var args = Array.from(arguments); | ||||
var opts = args[2] = args[2] || {} | var opts = args[2] = args[2] || {} | ||||
opts.title ? null : opts.title = `${args[0]} ${args[1] }` | opts.title ? null : opts.title = `${args[0]} ${args[1] }` | ||||
const child = spawn(...arguments); | |||||
// // const spawn = require('child_process').spawn; | // // const spawn = require('child_process').spawn; | ||||
// const s = spawn( | // const s = spawn( | ||||
// 'C:\\Program Files\\Git\\bin\\sh.exe' | // 'C:\\Program Files\\Git\\bin\\sh.exe' | ||||
// , ['notepad', 'index'], { cwd: __dirname }); | // , ['notepad', 'index'], { cwd: __dirname }); | ||||
// var interval = null; | |||||
// var t = setTimeout(function(){ | |||||
// interval = setInterval(function(){ | |||||
// console.log('Awaiting close : ' + child.spawnargs) | |||||
// }, 1500) | |||||
// // console.log('Awaiting close : ' + child.spawnargs) | |||||
// }, 0) | |||||
// child.on('close', (code) => { | |||||
// console.error('Prematurely closed even before promise...') | |||||
// }) | |||||
// D:\chess\instances\elixir_01\elxr/.elxr/run-1630002739610/download.bat https://github.com/git-for-windows/git/releases/download/v2.33.0.windows.2/Git-2.33.0.2-64-bit.exe D:\\chess\\instances\\elixir_01\\elxr/Downloads/Git-2.33.0.2-64-bit.exe | |||||
// D:\\chess\\instances\\elixir_01\\elxr/.elxr/run-1630002923584/download.bat https://github.com/git-for-windows/git/releases/download/v2.33.0.windows.2/Git-2.33.0.2-64-bit.exe D:\\chess\\instances\\elixir_01\\elxr/Downloads/Git-2.33.0.2-64-bit.exe | |||||
var p = new Promise(function(resolve, reject){ | var p = new Promise(function(resolve, reject){ | ||||
// console.log(...args) | |||||
const child = spawn(...args); | |||||
if(!opts.detached) { | if(!opts.detached) { | ||||
var messages = []; // PB : TODO -- Explore stream for Task level aggregation to prevent interleaved messages from multiple tasks... | var messages = []; // PB : TODO -- Explore stream for Task level aggregation to prevent interleaved messages from multiple tasks... | ||||
var success = true; | var success = true; | ||||
chunk.trim() === '' ? null : messages.push(chunk); /* console.log('d: ' + chunk) */ | chunk.trim() === '' ? null : messages.push(chunk); /* console.log('d: ' + chunk) */ | ||||
process.stdout.write( chunk ) | process.stdout.write( chunk ) | ||||
}); | }); | ||||
child.on('error', (chunk) => { success = false; messages.push(chunk); /* console.error('e: ' + chunk) */ } ); | |||||
child.on('error', (chunk) => { success = false; messages.push(chunk); /* console.error('e: ' + chunk) */ | |||||
console.log('Error exit not handled.') | |||||
} ); | |||||
child.stderr.on('data', (chunk) => { | child.stderr.on('data', (chunk) => { | ||||
if(messages.join('').indexOf('fatal: not a git repository') > -1) opts.haserrors = true; | if(messages.join('').indexOf('fatal: not a git repository') > -1) opts.haserrors = true; | ||||
messages.push(chunk); | messages.push(chunk); | ||||
}); | }); | ||||
} | } | ||||
child.on('close', (code) => { | child.on('close', (code) => { | ||||
// console.log('Proper close was fired') | |||||
var logEntry = { code, success } | var logEntry = { code, success } | ||||
if(+code !== 0 || opts.haserrors) { success = false; logEntry = { result: `${opts.title} exited with code ${code}`, success, code }}; | |||||
if(+code !== 0 || opts.haserrors) { success = false; logEntry = { messages, result: `${opts.title} exited with code ${code}`, success, code } | |||||
if(opts.evaluateResult) logEntry = opts.evaluateResult(false, logEntry); | |||||
}; | |||||
if(opts.stdio !== 'ignore') { | if(opts.stdio !== 'ignore') { | ||||
logEntry = { result: `${opts.title} exited with code ${code}`, messages, code } | logEntry = { result: `${opts.title} exited with code ${code}`, messages, code } | ||||
logEntry.success = success; | logEntry.success = success; | ||||
if(opts.evaluateResult) logEntry = opts.evaluateResult(success, logEntry); | |||||
if(opts.runas){ | if(opts.runas){ | ||||
// success ? logEntry.success = true : null; | // success ? logEntry.success = true : null; | ||||
fs.writeFileSync('run.log', ', ' + JSON.stringify(logEntry), {'flag':'a+'} ) | fs.writeFileSync('run.log', ', ' + JSON.stringify(logEntry), {'flag':'a+'} ) | ||||
process.stdout.write( messages.join('') ) | process.stdout.write( messages.join('') ) | ||||
} | } | ||||
} | } | ||||
// clearInterval(interval) | |||||
if(code !== 0 || opts.haserrors) return reject(logEntry) | if(code !== 0 || opts.haserrors) return reject(logEntry) | ||||
resolve(logEntry) | resolve(logEntry) | ||||
}); | }); | ||||
} | } | ||||
else { | else { | ||||
child.unref() | child.unref() | ||||
// clearInterval(interval) | |||||
resolve(true); | resolve(true); | ||||
} | } | ||||
}); | }); | ||||
p.process = child; | |||||
// p.process = child; | |||||
return p; | return p; | ||||
} | } | ||||
var prompt = function(choices, label){ | |||||
var prompt = function(choices, label, defaultchoice){ | |||||
var choices = choices || []; | |||||
return this.prompter.ask( | return this.prompter.ask( | ||||
`${label} \n ` + Object.keys(choices).map(choice => { return ` ${(+choice) + 1}) ${choices[choice]} `}).join('\n') + `\n default ( <= ${choices[0]} ) : ` | |||||
`${label} \n` + Object.keys(choices).map(choice => { return ` ${(+choice) + 1}) ${choices[choice]} `}).join('\n') + `\n default ( <= ${ defaultchoice || choices[0]} ) : ` | |||||
).then(choice => { | ).then(choice => { | ||||
if(!choice) return choices[0]; | |||||
// propName = promptable.interpret(propValue) | |||||
if(!choice) return defaultchoice || choices[0]; | |||||
if(choice && isNaN(+choice)) return choice; | if(choice && isNaN(+choice)) return choice; | ||||
return choices[choice + 1]; | |||||
return choices[(+choice) - 1]; | |||||
}) | }) | ||||
} | } | ||||
var cli = { | var cli = { | ||||
nodeShellExec | nodeShellExec | ||||
, get prompter() { | , get prompter() { | ||||
const clii = readline.createInterface({ input: process.stdin, output: process.stdout }); | |||||
clii.ask = function(q){ | |||||
return new Promise((resolve, reject)=>{ | |||||
clii.question(q, (answer)=>{ resolve(answer) }) | |||||
}) | |||||
var prompt_interface = { | |||||
ask : function(q){ | |||||
// Needs to be serialized. Parallel asks are not possible. | |||||
const clii = readline.createInterface({ input: process.stdin, output: process.stdout }); | |||||
return new Promise((resolve, reject)=>{ | |||||
clii.question(q, (answer)=>{ | |||||
try { | |||||
clii.close(); | |||||
console.log("readline.createInterface closed"); | |||||
resolve(answer) | |||||
} | |||||
catch(e) { | |||||
reject(e) | |||||
} | |||||
}) | |||||
}) | |||||
} | |||||
} | } | ||||
return clii | |||||
return prompt_interface | |||||
} | } | ||||
, prompt | , prompt | ||||
} | } |
{ | |||||
"name": "elxr", | |||||
"version": "1.0.0", | |||||
"lockfileVersion": 1, | |||||
"requires": true, | |||||
"dependencies": { | |||||
"@rollup/plugin-commonjs": { | |||||
"version": "17.1.0", | |||||
"resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-17.1.0.tgz", | |||||
"integrity": "sha512-PoMdXCw0ZyvjpCMT5aV4nkL0QywxP29sODQsSGeDpr/oI49Qq9tRtAsb/LbYbDzFlOydVEqHmmZWFtXJEAX9ew==", | |||||
"dev": true, | |||||
"requires": { | |||||
"@rollup/pluginutils": "^3.1.0", | |||||
"commondir": "^1.0.1", | |||||
"estree-walker": "^2.0.1", | |||||
"glob": "^7.1.6", | |||||
"is-reference": "^1.2.1", | |||||
"magic-string": "^0.25.7", | |||||
"resolve": "^1.17.0" | |||||
} | |||||
}, | |||||
"@rollup/plugin-node-resolve": { | |||||
"version": "11.2.1", | |||||
"resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-11.2.1.tgz", | |||||
"integrity": "sha512-yc2n43jcqVyGE2sqV5/YCmocy9ArjVAP/BeXyTtADTBBX6V0e5UMqwO8CdQ0kzjb6zu5P1qMzsScCMRvE9OlVg==", | |||||
"dev": true, | |||||
"requires": { | |||||
"@rollup/pluginutils": "^3.1.0", | |||||
"@types/resolve": "1.17.1", | |||||
"builtin-modules": "^3.1.0", | |||||
"deepmerge": "^4.2.2", | |||||
"is-module": "^1.0.0", | |||||
"resolve": "^1.19.0" | |||||
} | |||||
}, | |||||
"@rollup/pluginutils": { | |||||
"version": "3.1.0", | |||||
"resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-3.1.0.tgz", | |||||
"integrity": "sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==", | |||||
"dev": true, | |||||
"requires": { | |||||
"@types/estree": "0.0.39", | |||||
"estree-walker": "^1.0.1", | |||||
"picomatch": "^2.2.2" | |||||
}, | |||||
"dependencies": { | |||||
"estree-walker": { | |||||
"version": "1.0.1", | |||||
"resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-1.0.1.tgz", | |||||
"integrity": "sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg==", | |||||
"dev": true | |||||
} | |||||
} | |||||
}, | |||||
"@types/estree": { | |||||
"version": "0.0.39", | |||||
"resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz", | |||||
"integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==", | |||||
"dev": true | |||||
}, | |||||
"@types/node": { | |||||
"version": "15.0.2", | |||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-15.0.2.tgz", | |||||
"integrity": "sha512-p68+a+KoxpoB47015IeYZYRrdqMUcpbK8re/zpFB8Ld46LHC1lPEbp3EXgkEhAYEcPvjJF6ZO+869SQ0aH1dcA==", | |||||
"dev": true | |||||
}, | |||||
"@types/resolve": { | |||||
"version": "1.17.1", | |||||
"resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-1.17.1.tgz", | |||||
"integrity": "sha512-yy7HuzQhj0dhGpD8RLXSZWEkLsV9ibvxvi6EiJ3bkqLAO1RGo0WbkWQiwpRlSFymTJRz0d3k5LM3kkx8ArDbLw==", | |||||
"dev": true, | |||||
"requires": { | |||||
"@types/node": "*" | |||||
} | |||||
}, | |||||
"ansi-styles": { | |||||
"version": "4.3.0", | |||||
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", | |||||
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", | |||||
"requires": { | |||||
"color-convert": "^2.0.1" | |||||
} | |||||
}, | |||||
"balanced-match": { | |||||
"version": "1.0.2", | |||||
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", | |||||
"integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" | |||||
}, | |||||
"bbhverse": { | |||||
"version": "file:../bbhverse" | |||||
}, | |||||
"brace-expansion": { | |||||
"version": "1.1.11", | |||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", | |||||
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", | |||||
"requires": { | |||||
"balanced-match": "^1.0.0", | |||||
"concat-map": "0.0.1" | |||||
} | |||||
}, | |||||
"builtin-modules": { | |||||
"version": "3.2.0", | |||||
"resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.2.0.tgz", | |||||
"integrity": "sha512-lGzLKcioL90C7wMczpkY0n/oART3MbBa8R9OFGE1rJxoVI86u4WAGfEk8Wjv10eKSyTHVGkSo3bvBylCEtk7LA==", | |||||
"dev": true | |||||
}, | |||||
"chalk": { | |||||
"version": "4.1.1", | |||||
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz", | |||||
"integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==", | |||||
"requires": { | |||||
"ansi-styles": "^4.1.0", | |||||
"supports-color": "^7.1.0" | |||||
} | |||||
}, | |||||
"color-convert": { | |||||
"version": "2.0.1", | |||||
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", | |||||
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", | |||||
"requires": { | |||||
"color-name": "~1.1.4" | |||||
} | |||||
}, | |||||
"color-name": { | |||||
"version": "1.1.4", | |||||
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", | |||||
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" | |||||
}, | |||||
"commondir": { | |||||
"version": "1.0.1", | |||||
"resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", | |||||
"integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", | |||||
"dev": true | |||||
}, | |||||
"concat-map": { | |||||
"version": "0.0.1", | |||||
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", | |||||
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" | |||||
}, | |||||
"dateformat": { | |||||
"version": "4.5.1", | |||||
"resolved": "https://registry.npmjs.org/dateformat/-/dateformat-4.5.1.tgz", | |||||
"integrity": "sha512-OD0TZ+B7yP7ZgpJf5K2DIbj3FZvFvxgFUuaqA/V5zTjAtAAXZ1E8bktHxmAGs4x5b7PflqA9LeQ84Og7wYtF7Q==", | |||||
"dev": true | |||||
}, | |||||
"deepmerge": { | |||||
"version": "4.2.2", | |||||
"resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.2.2.tgz", | |||||
"integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==", | |||||
"dev": true | |||||
}, | |||||
"estree-walker": { | |||||
"version": "2.0.2", | |||||
"resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", | |||||
"integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", | |||||
"dev": true | |||||
}, | |||||
"fs.realpath": { | |||||
"version": "1.0.0", | |||||
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", | |||||
"integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" | |||||
}, | |||||
"function-bind": { | |||||
"version": "1.1.1", | |||||
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", | |||||
"integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", | |||||
"dev": true | |||||
}, | |||||
"glob": { | |||||
"version": "7.1.7", | |||||
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", | |||||
"integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==", | |||||
"requires": { | |||||
"fs.realpath": "^1.0.0", | |||||
"inflight": "^1.0.4", | |||||
"inherits": "2", | |||||
"minimatch": "^3.0.4", | |||||
"once": "^1.3.0", | |||||
"path-is-absolute": "^1.0.0" | |||||
} | |||||
}, | |||||
"has": { | |||||
"version": "1.0.3", | |||||
"resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", | |||||
"integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", | |||||
"dev": true, | |||||
"requires": { | |||||
"function-bind": "^1.1.1" | |||||
} | |||||
}, | |||||
"has-flag": { | |||||
"version": "4.0.0", | |||||
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", | |||||
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" | |||||
}, | |||||
"inflight": { | |||||
"version": "1.0.6", | |||||
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", | |||||
"integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", | |||||
"requires": { | |||||
"once": "^1.3.0", | |||||
"wrappy": "1" | |||||
} | |||||
}, | |||||
"inherits": { | |||||
"version": "2.0.4", | |||||
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", | |||||
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" | |||||
}, | |||||
"is-core-module": { | |||||
"version": "2.3.0", | |||||
"resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.3.0.tgz", | |||||
"integrity": "sha512-xSphU2KG9867tsYdLD4RWQ1VqdFl4HTO9Thf3I/3dLEfr0dbPTWKsuCKrgqMljg4nPE+Gq0VCnzT3gr0CyBmsw==", | |||||
"dev": true, | |||||
"requires": { | |||||
"has": "^1.0.3" | |||||
} | |||||
}, | |||||
"is-module": { | |||||
"version": "1.0.0", | |||||
"resolved": "https://registry.npmjs.org/is-module/-/is-module-1.0.0.tgz", | |||||
"integrity": "sha1-Mlj7afeMFNW4FdZkM2tM/7ZEFZE=", | |||||
"dev": true | |||||
}, | |||||
"is-reference": { | |||||
"version": "1.2.1", | |||||
"resolved": "https://registry.npmjs.org/is-reference/-/is-reference-1.2.1.tgz", | |||||
"integrity": "sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==", | |||||
"dev": true, | |||||
"requires": { | |||||
"@types/estree": "*" | |||||
} | |||||
}, | |||||
"lodash": { | |||||
"version": "4.17.21", | |||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", | |||||
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", | |||||
"dev": true | |||||
}, | |||||
"magic-string": { | |||||
"version": "0.25.7", | |||||
"resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.7.tgz", | |||||
"integrity": "sha512-4CrMT5DOHTDk4HYDlzmwu4FVCcIYI8gauveasrdCu2IKIFOJ3f0v/8MDGJCDL9oD2ppz/Av1b0Nj345H9M+XIA==", | |||||
"dev": true, | |||||
"requires": { | |||||
"sourcemap-codec": "^1.4.4" | |||||
} | |||||
}, | |||||
"minimatch": { | |||||
"version": "3.0.4", | |||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", | |||||
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", | |||||
"requires": { | |||||
"brace-expansion": "^1.1.7" | |||||
} | |||||
}, | |||||
"once": { | |||||
"version": "1.4.0", | |||||
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", | |||||
"integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", | |||||
"requires": { | |||||
"wrappy": "1" | |||||
} | |||||
}, | |||||
"path-is-absolute": { | |||||
"version": "1.0.1", | |||||
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", | |||||
"integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" | |||||
}, | |||||
"path-parse": { | |||||
"version": "1.0.6", | |||||
"resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", | |||||
"integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", | |||||
"dev": true | |||||
}, | |||||
"picomatch": { | |||||
"version": "2.2.3", | |||||
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.3.tgz", | |||||
"integrity": "sha512-KpELjfwcCDUb9PeigTs2mBJzXUPzAuP2oPcA989He8Rte0+YUAjw1JVedDhuTKPkHjSYzMN3npC9luThGYEKdg==", | |||||
"dev": true | |||||
}, | |||||
"resolve": { | |||||
"version": "1.20.0", | |||||
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz", | |||||
"integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==", | |||||
"dev": true, | |||||
"requires": { | |||||
"is-core-module": "^2.2.0", | |||||
"path-parse": "^1.0.6" | |||||
} | |||||
}, | |||||
"rollup-plugin-version-injector": { | |||||
"version": "1.3.3", | |||||
"resolved": "https://registry.npmjs.org/rollup-plugin-version-injector/-/rollup-plugin-version-injector-1.3.3.tgz", | |||||
"integrity": "sha512-+Rrf0xIFHkwFGuMfphVlAOtd9FlhHFh3vrDwamJ6+YR3IxebRHGVT879qwWzZ1CpWMCLlngb2MmHW5wC5EJqvg==", | |||||
"dev": true, | |||||
"requires": { | |||||
"chalk": "^4.1.0", | |||||
"dateformat": "^4.2.1", | |||||
"lodash": "^4.17.20" | |||||
} | |||||
}, | |||||
"sourcemap-codec": { | |||||
"version": "1.4.8", | |||||
"resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz", | |||||
"integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==", | |||||
"dev": true | |||||
}, | |||||
"supports-color": { | |||||
"version": "7.2.0", | |||||
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", | |||||
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", | |||||
"requires": { | |||||
"has-flag": "^4.0.0" | |||||
} | |||||
}, | |||||
"tree-kill": { | |||||
"version": "1.2.2", | |||||
"resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz", | |||||
"integrity": "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==" | |||||
}, | |||||
"wrappy": { | |||||
"version": "1.0.2", | |||||
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", | |||||
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" | |||||
} | |||||
} | |||||
} |
"main": "index.js", | "main": "index.js", | ||||
"scripts": { | "scripts": { | ||||
"test": "echo \"Error: no test specified\" && exit 1", | "test": "echo \"Error: no test specified\" && exit 1", | ||||
"build-commented": "rollup index.js --format cjs --file elxr.js", | |||||
"build": "rollup -c", | |||||
"build-elxr": "rollup index.js --format cjs --file elxr.js", | |||||
"build": "rollup -c && rollup index.js --format cjs --file elxr.js", | |||||
"index": "SET FORCE_COLOR=true && node index" | "index": "SET FORCE_COLOR=true && node index" | ||||
}, | }, | ||||
"keywords": [], | "keywords": [], | ||||
"crossfilter2": "^1.5.4", | "crossfilter2": "^1.5.4", | ||||
"chalk": "^4.1.0", | "chalk": "^4.1.0", | ||||
"glob": "^7.1.2", | "glob": "^7.1.2", | ||||
"uuid": "^8.3.2", | |||||
"tree-kill": "^1.2.2" | "tree-kill": "^1.2.2" | ||||
}, | }, | ||||
"bin": { | "bin": { |
module.exports = ((name, options)=>{ | |||||
return { | |||||
reposervers : [ | |||||
'http://git.bbh' | |||||
, 'https://git.bbh.org.in' | |||||
, '//172.16.0.27/repos' | |||||
, 'https://github.com' | |||||
] | |||||
// User can always add more branches and remotes as needed. Mainifest only occupies | |||||
// well defined namespaces | |||||
, remotes : [ | |||||
// these are both fetch and push remotes. Use push - remotes to override push. | |||||
{ 'chess' : `${options.reposerver}/chess/elxr.git` } | |||||
, { 'public-github-baptistdev' : 'https://github.com/baptistdev/elxr.git' } | |||||
// Multiple urls dont tell us the current origin which may be | |||||
// different based on currently available/accessible based on device and client. | |||||
// We just treat them as different remotes and merge as needed. | |||||
// | |||||
, { 'origin' : `${options.reposerver}/${options.repouser}/elxr.git` } | |||||
, { 'origin-public' : `https://git.bbh.org.in/${options.repouser}/elxr.git` } | |||||
, { 'origin-unc' : `//172.16.0.27/repos/${options.repouser}/elxr.git` } | |||||
] | |||||
, 'push-remotes' : [ | |||||
{ 'chess' : 'no-pushing' } | |||||
, { 'public-baptistdev' : 'no-pushing' } | |||||
, { 'public-origin' : 'no-pushing' } | |||||
] | |||||
// , 'fetch-remotes' : [] // Multiple fetch remotes are not supported by git. | |||||
// We therefore need to use | |||||
// - a pullall | |||||
// - or branch alias for multiple remote branch tracking branch strategy. | |||||
// -- This is however limited to corresponding branch names | |||||
// tracking branches. | |||||
// We at least need one branch for each remote that we wish to track. | |||||
// , 'tracking-branches' : [ | |||||
// { master : ['origin/master', 'chess/master'] } | |||||
// ] | |||||
} | |||||
}) |
// exclude : [ 'chessinstances.js' ] | // exclude : [ 'chessinstances.js' ] | ||||
}), nodeResolve(), versionInjector()] | }), nodeResolve(), versionInjector()] | ||||
}; | }; | ||||
// Dr Kamat | |||||
// Rahul Roji | |||||
// 06259 |
<html><HTA:APPLICATION ID="windowselevate" icon="#"/> | |||||
<script language="vbscript"> | |||||
document.title = "elxr control panel" | |||||
self.ResizeTo 200,600 | |||||
Sub Window_Onload | |||||
self.MoveTo (screen.availWidth - (document.body.clientWidth + 40)),10 | |||||
End Sub | |||||
Set objShell = CreateObject("WScript.Shell") | |||||
Set objENV = objShell.Environment("Process") | |||||
dim NODE_ENV | |||||
NODE_ENV = objENV("NODE_ENV") | |||||
</script> | |||||
<script language="javascript"> | |||||
//WINDOWSTATE="minimize" SHOWINTASKBAR="no" SYSMENU="no" CAPTION="no" | |||||
// https://devblogs.microsoft.com/scripting/how-can-i-pass-command-line-variables-to-an-hta-when-it-starts/ | |||||
// alert(windowselevate.commandLine) | |||||
var args = windowselevate.commandLine.split('"').slice(3); | |||||
// alert(args) | |||||
var processedArgs = { _ : [] } | |||||
var namedArgs = []; | |||||
for(var item in args){ | |||||
if(args[item].charAt(0) === '-'){ | |||||
namedArgs.push(args[item]) | |||||
var split = args[item].split('='); | |||||
processedArgs[split[0].slice(2)] = split[1] || true; | |||||
} | |||||
else processedArgs._.push(args[item]); | |||||
} | |||||
// args = args.forEach(function(item){ }) | |||||
// alert('processedArgs._ : ' + processedArgs._); | |||||
// alert(processedArgs.runas); | |||||
// PB : TODO -- Convert all the cli args back to string. | |||||
var cargs = (processedArgs.debug ? '--inspect-brk=9228' : '') + ' elxr ' + processedArgs._.join(' ') + ' ' + namedArgs.join(' '); | |||||
// alert(cargs) | |||||
var shell = new ActiveXObject('shell.application'); | |||||
// alert('launching node privilged. ' + processedArgs['nodepath']) | |||||
// shell.ShellExecute('where', 'node', '', '', 10); | |||||
shell.ShellExecute('node', cargs, '', 'runas', 1); | |||||
// shell.ShellExecute(processedArgs['nodepath'], cargs, '', 'runas', 1); | |||||
var fso = new ActiveXObject('Scripting.FileSystemObject'); | |||||
window.onload = function() { | |||||
document.body.style.backgroundColor = 'black'; | |||||
document.body.style.fontFamily = 'arial'; | |||||
var log = document.createElement('div'); | |||||
log.innerHTML='Please Wait'; | |||||
function l(msg){ log.innerHTML+= msg; }; | |||||
log.style.color = 'blue'; | |||||
log.style.width = '95%'; | |||||
log.id = 'log'; | |||||
document.body.appendChild(log); | |||||
l('<Br/>Current config : ') | |||||
l('<Br/>NODE_ENV = ' + NODE_ENV) | |||||
l('<Br/>cmd = ' + processedArgs._[0]) | |||||
processedArgs._[1] === 'use' ? l('<Br/>using = ' + processedArgs._[2]) : null; | |||||
l('<Br/><Br/>') | |||||
var timer = function(){ | |||||
l('.'); | |||||
if(fso.FileExists("run.done")) close(); | |||||
else window.setTimeout(timer, 1000); | |||||
}; | |||||
window.setTimeout(timer, 3000); | |||||
}; | |||||
</script> | |||||
</html> |