Ver código fonte

Elxr Upgrades

master
pb 1 ano atrás
pai
commit
0c94636753
1 arquivos alterados com 44 adições e 39 exclusões
  1. 44
    39
      index.js

+ 44
- 39
index.js Ver arquivo

@@ -3,6 +3,7 @@

"use strict";


var __g = require('global-this');
var ENV = Object.assign({}, process.env); // Shallow clone so we can set values and reuse for reshelling spawns.
__g.env = ENV
@@ -15,6 +16,7 @@ var Tasq = utils.Tasq
var statuslog = utils.Traq
var Traq = utils.Traq


var ENV = Object.assign({}, process.env); // Shallow clone so we can set values and reuse for reshelling spawns.
const cliargs = utils.cliargs;
const processedArgs = cliargs(process.argv.slice(2));
@@ -265,6 +267,31 @@ shell_verse.acquireElevationState().then((isElevated) => {
// , 'undefined' : true
}

var __default = {
// Common baseline repos for all chess chessinstances.
repos : [
{ repo : 'ember-masonry-grid' /*, branch : master*/ } // Default need not be specified.
, { repo : 'bbhverse' }
, { repo : 'clientverse' }
, { repo : 'serververse' }
, { repo : 'elxr' }
, { repo : 'ember-searchable-select' }
, { repo : 'loopback-component-jsonapi' }
, { repo : 'loopback-jsonapi-model-serializer' }
, { repo : 'loopback-connector-mysql' }
, { repo : 'loopback-connector-ds' }
, { repo : 'ember-service-worker' }
, { repo : 'ember-service-worker-asset-cache' }
, { repo : 'ember-service-worker-cache-fallback' }
, { repo : 'ember-service-worker-index' }
, { repo : 'ember-sw-client-route' }
, { repo : 'global-this' }
]
// Requires elevation only in windows
, elevated : [ { repo : 'chess-server-lib', requiresElevation : true } ]
, exludeMergeRepos : { }
}; // PB : TODO -- Use initialized instance instead of __default everywhere.

var cmds = {
remote : {
interpret() { return utils.assign_core( { keycase: true, arraymergetype : utils.assign_core.DISTINCT_UNION }
@@ -412,7 +439,7 @@ shell_verse.acquireElevationState().then((isElevated) => {
, switch : {
interpret() {
return { cmd : subcommandlabels['switch'], runchoice : 'c', username : processedArgs._[2]
, reposerver : __default.reposerver
, reposerver : __default.reposerver // .?.?.?
}
}
, getPossiblePrompts(){ return { username : true, reposerver : 'http://git.bbh' } } // Requires only one argument...
@@ -516,6 +543,7 @@ shell_verse.acquireElevationState().then((isElevated) => {
var interpreted = this
// Non custom command has universal positiona args.
processedArgs._[1] ? interpreted.instanceName = processedArgs._[1] : null;
interpreted.runchoice = interpreted.cmd ? 'c' : null
// interpreted.runchoice = processedArgs._[0] || selectedinstance.runchoice;
// return clioverrides
// cmds[cmd] = {
@@ -698,7 +726,7 @@ shell_verse.acquireElevationState().then((isElevated) => {
if( shouldPrompt(k, possiblePrompts, target) ) {
delete reconfirm[k];
// console.log(k)
console.dir(possiblePrompts); //console.dir(target)
// console.dir(possiblePrompts); //console.dir(target)
prompts.push(async ()=>{
// PB : NOTE -- Important in async cases when this {{target}} needs to be in the same state as when it was invoked.
// We need to take a snapshot... Shallow.. !! If required deep should be used based on use case.
@@ -927,6 +955,14 @@ shell_verse.acquireElevationState().then((isElevated) => {
// PB : TODO -- Override cli prefs and call with undefined selectedinstance only if there is no cli overide or selection.
acquirelocalinstances( { root : ENV.wd } )

function createLocalChessInstance( cfg ){
// return createInstance(cfg)
reconfirm = getReconfirmAll()
var inst = {};
var __new = Object.assign({}, __default, cfg)
inst[cfg.node_env] = __new; return inst;
}

if(chessinstances.error) {
delete chessinstances.error
// use installchoices only when we don't find chessinstances.
@@ -983,31 +1019,7 @@ shell_verse.acquireElevationState().then((isElevated) => {
return pendingtasks.then((instance)=>{
// PB : TODO -- Embed defaults in the build instead of inlining here...
var __default = {
// Common baseline repos for all chess chessinstances.
repos : [
{ repo : 'ember-masonry-grid' /*, branch : master*/ } // Default need not be specified.
, { repo : 'bbhverse' }
, { repo : 'clientverse' }
, { repo : 'serververse' }
, { repo : 'elxr' }
, { repo : 'ember-searchable-select' }
, { repo : 'loopback-component-jsonapi' }
, { repo : 'loopback-jsonapi-model-serializer' }
, { repo : 'loopback-connector-mysql' }
, { repo : 'loopback-connector-ds' }
, { repo : 'ember-service-worker' }
, { repo : 'ember-service-worker-asset-cache' }
, { repo : 'ember-service-worker-cache-fallback' }
, { repo : 'ember-service-worker-index' }
, { repo : 'ember-sw-client-route' }
, { repo : 'global-this' }
]
// Requires elevation only in windows
, elevated : [ { repo : 'chess-server-lib', requiresElevation : true } ]
, exludeMergeRepos : { }
}; // PB : TODO -- Use initialized instance instead of __default everywhere.
// PB : TODO -- All these values instanceName, node_env, username, reposervers should come from instace overridden by a finalized cliovrrides...
// Also attepmt to load preconfig specially for new chessinstances from ../chess-config/...
@@ -1050,7 +1062,7 @@ shell_verse.acquireElevationState().then((isElevated) => {
, instance_specific_config_manifest
, clioverrides
)
console.dir(__pvt)
// console.dir(__pvt)
// Unmergable server overrides
Object.keys(instance_specific_config_manifest).forEach( key => {
__pvt[key] = instance_specific_config_manifest[key]
@@ -4658,15 +4670,6 @@ shell_verse.acquireElevationState().then((isElevated) => {
}
// promptkeys.runchoice = promptkeys.cmd ? 'c' : undefined

function createLocalChessInstance( cfg ){
// return createInstance(cfg)
reconfirm = getReconfirmAll()
var inst = {};
var __new = Object.assign({}, __default, cfg)
inst[cfg.node_env] = __new; return inst;
}


var choices = {
'instanceName' : []
, 'reposerver' : []
@@ -4682,8 +4685,10 @@ shell_verse.acquireElevationState().then((isElevated) => {
var remotes = [];
var instanceNames = []
var instanceTypes = ['development', 'production'];

// Accumulate all known choices from every possible instance...
Object.keys( chessinstances).forEach(instanceName => {
if(instanceName === 'current_run') return;
if(instanceName === 'current_run') return ;
Object.keys( chessinstances[instanceName] ).forEach(node_env=>{
var instance = chessinstances[instanceName][node_env];
reposervers = reposervers.concat(instance.reposervers)
@@ -5299,7 +5304,7 @@ shell_verse.acquireElevationState().then((isElevated) => {
// if(cmdprompts.instanceName) {
// not an instanceless cmd.
console.dir(selectedinstance)
// console.dir(selectedinstance)
try {

// chessinstances = acquirelocalinstances(selectedinstance);

Carregando…
Cancelar
Salvar