소스 검색

Fixes

master^2
guest 3 년 전
부모
커밋
32c20377d8
4개의 변경된 파일77개의 추가작업 그리고 8개의 파일을 삭제
  1. 1
    1
      elxr.js
  2. 3
    3
      i.js
  3. 55
    0
      i.win.js
  4. 18
    4
      index.js

+ 1
- 1
elxr.js 파일 보기

@@ -1893,7 +1893,7 @@ var cmds = {

var elxrcmd = (function(){

__cmdprototype = function(){};
var __cmdprototype = function(){};
function subcommandlabelFor(cmd, sub){ return (`${cmd} ${sub || ''}`).trim() }

var __cmd = {

+ 3
- 3
i.js 파일 보기

@@ -1,4 +1,4 @@
/* Version: 1.0.0 - December 2, 2021 21:12:33 */
/* Version: 1.0.0 - December 3, 2021 11:58:46 */
'use strict';

var path$1 = require('path');
@@ -25205,7 +25205,7 @@ var getCredentials = function(){
};

const __ALIAS__STAMP__ = '9e7bebe0-1f57-11ec-8f88-778ffeea9d1b';
const BUILD_VERSION = 'Version: 1.0.0 - built on December 2, 2021 21:12:33';
const BUILD_VERSION = 'Version: 1.0.0 - built on December 3, 2021 11:58:46';
const runtimestamp = (new Date()).getTime();
function getVersion() { return BUILD_VERSION; }
console.log(getVersion());
@@ -27072,7 +27072,7 @@ var cmds = {

var elxrcmd = (function(){

__cmdprototype = function(){};
var __cmdprototype = function(){};
function subcommandlabelFor(cmd, sub){ return (`${cmd} ${sub || ''}`).trim() }

var __cmd = {

+ 55
- 0
i.win.js 파일 보기

@@ -853,7 +853,37 @@ function __main( selectedinstance ){
})
}

function unique(arr) {
var hash = {}, result = [];
for ( var i = 0, l = arr.length; i < l; ++i ) {
if ( !hash.hasOwnProperty(arr[i]) ) { //it works with objects! in FF, at least
hash[ arr[i] ] = true;
result.push(arr[i]);
}
}
return result;
}

// var ENV = Object.assign({}, process.env); // Shallow clone it.
var WshShell = WScript.CreateObject("WScript.Shell")
var ENV = WshShell.Environment("Process")
WScript.echo( ENV("Path") )
function sysAddPathVar(path){
// Object.assign({
// inherit: true, shell: true, env: ENV, title: `${command} ${args}`
// }, options)
// var newpath = ENV("Path").split(';');
// newpath = Array.from(new Set(newpath.push(path))).join(';')
var newpath = [];
newpath.push(path)
newpath = unique(newpath).join(';')
// path.split(';').forEach(pel => { var kv = pel.split('='); kv[0] === key ? null : newpath.push(pel); } )
return any([nodeShellExec('setx', [/*'/m',*/ 'PATH', '"%PATH%;' + newpath + '"' ])
// , nodeShellExec('set', [/*'/m',*/ 'PATH', '"%PATH%;' + newpath + '"' ])
] );
}
var prerequisites = [
{
shellcmd: 'git',
@@ -1023,6 +1053,31 @@ function __main( selectedinstance ){
// return any([any(steps), any(prompts)])
}
}
, {
shellcmd: 'python2'
, url: 'https://www.python.org/ftp/python/2.7.18/python-2.7.18.amd64.msi'
, installer: 'python-2.7.18.amd64.msi'
, installcmd: ['MSIEXEC.exe', ['/i'
, path.normalize(downloadsdir + '/' + 'python-2.7.18.amd64.msi')
, 'ACCEPT=YES', '/passive']]
, preinstallsteps : function() { return Promise.resolve(true) }
, install : function() {
var self = this;
var ifns = [self.installcmd]
if(!ifns.map) ifns.map = map;
console.log('Installing')
return any(ifns.map(callsheltask))['catch'](function(e){
if(e.code === 1602) {
console.warn("Installation was probably cancelled.")
}
else throw e
}).then(function(){
return self.postinstallsteps()
})
}
, postinstallsteps : function() { return sysAddPathVar('%USERPROFILE%\\AppData/Local\\Microsoft\\WindowsApps') }
, exists : exists
}
,
{
shellcmd: 'elxr'

+ 18
- 4
index.js 파일 보기

@@ -10,6 +10,21 @@ var nodeShellExec = cli.nodeShellExec;
var chalk = require('chalk')
const homedir = require('os').homedir();


var ENV = Object.assign({}, process.env); // Shallow clone it.

function sysAddPathVar(path){
// Object.assign({
// inherit: true, shell: true, env: ENV, title: `${command} ${args}`
// }, options)
var newpath = path.split(';');
newpath = Array.from(new Set(newpath.push(path))).join(';')
// path.split(';').forEach(pel => { var kv = pel.split('='); kv[0] === key ? null : newpath.push(pel); } )
return nodeShellExec('setx', ['/m', 'PATH', newpath ]);
}

// singleton one time lazy
var getCredentials = function(){

@@ -102,8 +117,6 @@ console.dir(processedArgs)

var globSync = require('glob').sync;

var ENV = Object.assign({}, process.env); // Shallow clone it.

const { readdir } = require("fs").promises

// Directory shallow walk and do perform on each dir.
@@ -1945,7 +1958,7 @@ var cmds = {

var elxrcmd = (function(){

__cmdprototype = function(){}
var __cmdprototype = function(){}
function subcommandlabelFor(cmd, sub){ return (`${cmd} ${sub || ''}`).trim() }

var __cmd = {
@@ -2455,7 +2468,8 @@ var __acquireConfig = function (selected, owner, clusternodename, configrepo, er
var successHandler = () => {

var manifestpath = path.normalize(selected.root + '/' + selected.instanceName + '-config-' + selected.node_env + '/repo-manifest');
selectedinstance = require(manifestpath)( null, selectedinstance)
utils.assign_strict(selectedinstance, require(manifestpath)( null, selectedinstance))
console.dir(selectedinstance.repos)
// Config from server always override merges into selection except for the current selection.
// PB : TODO -- utils.assign Array merges are non-distinct...
if(!selectedinstance.repos[0].repo) {

Loading…
취소
저장