1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768 |
- var scripthostName = 'node'
- var __Promise = {};
- var promises = [];
- function startPromises(){
- promises.forEach(function(p){
-
- p ? p() : null;
-
- })
- }
-
- function isWin(){ return /^win/.test(process.platform) }
- var stampedFilePfx = function(date) {
- return date.getFullYear() +
- ('0' + (date.getMonth() + 1)).slice(-2) +
- ('0' + date.getDate()).slice(-2) +
- ('0' + date.getHours()).slice(-2) +
- ('0' + date.getMinutes()).slice(-2) +
- ('0' + date.getSeconds()).slice(-2);
- }
- var runtimestamp = (new Date()).getTime();
-
- try {
- console.log("detected node")
-
-
-
- __Promise = Promise
- var __require = require
- var map = Array.map
-
- function startPromises(){
- promises.forEach(function(p){
-
- p ? Promise.resolve(p) === p ? p : p() : null;
-
- })
- }
-
-
-
-
-
- WScript = function(){}
- WScript.Echo = function(m){
- console.log('Invalid Wscript')
- throw "Failed in Node Run."
- }
- var wait = function(ms, cb) {any
- return new __Promise(function(resolve){ setTimeout(resolve, ms) } ).then(function(){ cb() });
- }
- var fs = require('fs')
- var existsSync = require('fs').existsSync;
- var existsSyncFolder = existsSync
- var path = require('path');
- console.log('before cliverse')
- var cli = require('./cliverse')
- var nodeShellExec = cli.nodeShellExec;
- console.log('before bbhverse')
- var utils = require('bbhverse');
-
-
- var any = utils.any;
- var wait = setTimeout
-
-
-
-
- var selectedinstance = { root : path.resolve(".") }
- __main(selectedinstance)
-
-
-
- }
- catch(e) {
- WScript.Echo('detected wsh')
- scripthostName = 'wsh'
- WScript.Echo(WScript.FullName)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- var all = WScript.Arguments.Named('all');
-
- trim = function(str) { return str.replace(/^\s+|\s+$/g, ''); };
-
- var fs = new ActiveXObject('Scripting.FileSystemObject');
- var WshShell = WScript.CreateObject("WScript.Shell")
- var ENV = WshShell.Environment("Process")
- var sfn = WScript.ScriptFullName
-
- var cd = fs.GetAbsolutePathName(".")
- var cfn = cd + '\\i.win.js'
-
- var waslaunchedwithenv = trim(ENV.Item('LAUNCHEDWITHENV'));
-
-
- if(waslaunchedwithenv !== "YES"){
-
- var a = fs.CreateTextFile("launchwithenv.bat", true)
- a.WriteLine("@echo off")
- a.WriteLine("echo %PATH%")
- var gitpath = "C:\\Program Files\\Git\\cmd"
- var nodepath = "C:\\Program Files\\nodejs\\"
- var codepath = "C:\\Users\\Pradeep\\AppData\\Local\\Programs\\Microsoft VS Code\\bin"
- var python2path = "C:\\Python27"
- a.WriteLine("set PATH=%PATH%;" + gitpath )
- a.WriteLine("set PATH=%PATH%;" + nodepath )
- a.WriteLine("set PATH=%PATH%;" + codepath )
- a.WriteLine("set PATH=%PATH%;" + python2path )
-
-
- var __ALIAS__STAMP__ = '9e7bebe0-1f57-11ec-8f88-778ffeea9d1b'
- var currentIsExlr = function() {
- if(fs.FileExists('./' + __ALIAS__STAMP__)) return true
- }
- var runningInExlr = currentIsExlr()
- if(cfn === sfn && runningInExlr) {
- a.WriteLine("cd ..");
- a.WriteLine("SET LAUNCHEDWITHENV=YES && cscript "+cfn+" /all:true")
- }
- else {
- var guesselxr = fs.FileExists(cd + './elxr/' + __ALIAS__STAMP__)
- if(guesselxr) {
- a.WriteLine("SET LAUNCHEDWITHENV=YES && cscript "+cd + './elxr/' + 'i.win.js' +" /all:true")
- }
- else a.WriteLine("SET LAUNCHEDWITHENV=YES && cscript "+sfn+" /all:true")
- }
-
-
-
- a.Close()
- WshShell.run("cmd /k launchwithenv.bat")
- WScript.Quit()
-
-
- }
-
- console = {
- log : function(m) { WScript.Echo(m)}
- , error : function(m) {WScript.Echo(m) }
- , dir : function(o) {
- for(var i in o){ console.log(i + ' : ' + o[i])}
- }
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- var wsh = true;
- function isWin(){ return true; }
-
-
- var clii = {
- question : function(q, answercb){
- WScript.Echo(q)
-
- var answer = WScript.StdIn.ReadLine()
- answercb(answer)
- }
- }
- var prompter = {
- ask : function(q){
-
-
-
-
- return new Promise(function(resolve, reject){
- clii.question(q, function(answer){
-
-
- resolve(answer)
- })
- })
- }
- }
-
-
-
- var cli = {
- prompt : function(choices, label, defaultchoice){
- var options = [];
-
- choices.forEach = forEach
- choices.forEach(function(choice, i, a){
-
-
-
- options.push( ((+i) + 1) + ' ' + choice )
-
- })
-
- return prompter.ask( label + '\n' + options.join('\n') + '\n default ( <= ' + (defaultchoice || choices[0]) + ' ) : '
- ).then( function(choice){
- if(!choice) return defaultchoice || choices[0];
- if(choice && isNaN(+choice)) return choice;
- return choices[(+choice) - 1];
- })
- }
- }
-
- var any = function(iterable, continueOnFailure) {
-
- if(!iterable.reduce) iterable.reduce = reduce
-
- var cancelsignal = "cancelme{mangledrunid}"
- return iterable.reduce(
- function(p, tasq, i ,a) {
-
-
- var handleError = function(err, pVal){
- if(err !== cancelsignal) {
-
- console.warn('Possible failure for task with result : ' )
- console.log('Failed : ' + err.message + ' ')
- console.dir(pVal)
- console.dir(p)
- if(i>0 && a[i-1].info) console.dir(a[i-1].info)
- console.error('Error : ' + err.stack)
- console.error(a[i-1])
- a[i-1] ? console.log("tasq : " + a[i-1].toString()) : null;
- if(!continueOnFailure) {console.log("Cancelling remaining on any one failure ..."); throw cancelsignal}
- else return pVal;
-
- }
- }
-
- if(Promise.resolve(p) === p ) {
- if(i>0 && a[i-1].info) p.info = a[i-1].info;
- console.dir(' p.then is ' + p.then)
- return p.then( function(pVal){
-
-
-
-
-
-
-
-
- if(pVal && pVal.error) handleError(pVal, pVal)
-
- var trycall = function(tasq){
- try {
- var result = tasq()
- if(tasq.resultHandler) return tasq.resultHandler(result)
-
- return result
- } catch (error) {
- console.error(error);
- console.error('Error : ' + error ? error.stack : 'No stack')
- if(!continueOnFailure) throw error;
- }
- }
-
- var handleNext = function(){
-
-
- if(i>0 && a[i-1].info) console.dir(a[i-1].info)
- if(!tasq && !continueOnFailure) { console.log('Error : No task specified.'); throw false;}
- else if(!tasq) { console.log('Error : No task specified.'); return false;}
- return (Promise.resolve(tasq) === tasq ) ? tasq : trycall(tasq) ;
- }
-
- if(Promise.resolve(pVal) === pVal) {
-
- pVal.then(function(pVal){ return handleNext(); })
- }
- else return handleNext()
-
- })['catch'](function(error) {
- if(error !== cancelsignal) {
- console.log('E3 : i = ' + i);
- if(error.result) console.error(error.result)
- console.error('Error : ' + (error.message || error.messages))
- console.error('Error : ' + error.stack)
- tasq ? console.log("tasq : " + tasq.toString()) : null;
- console.log('debugData 3-------------------------');
-
- throw error
- }
- else throw cancelsignal;
- })
- }
- else if(!p) {
- handleError({ error : true, message : 'Failed without result' }, pVal)
- console.log("Bypass remaining on prior failure");
- return false;
- }
- else return p;
- }
- , Promise.resolve(true)
- );
- }
-
-
-
-
- function forEach(eachFn, o){
-
-
-
-
- if('' + this === '[object Object]') {
-
-
-
-
- for(var i in this){
- if(i === 'forEach') continue;
-
- eachFn(this[i], i, this)
- }
- }
- else {
- for(var i=0; i<this.length; i++) eachFn(this[i], i, this)
- }
- }
- function reduce(reducnFn, iv){
- var acc = iv
- for(var i=0; i<this.length; i++) {acc = reducnFn(acc, this[i], i, this) }
- return acc;
- }
-
- function map(eachFn){
- var mapped = []
- for(var i=0; i<this.length; i++) mapped.push(eachFn(this[i]))
- return mapped
- }
-
- var wait = function(cb, ms) { WScript.Sleep(ms); cb() }
- var fso = new ActiveXObject('Scripting.FileSystemObject');
- var existsSync = function(filepath){ return fso.FileExists(filepath) }
- var fs = {
- writeFileSync : function(filepath, text) {
-
-
-
-
- var fh = fso.CreateTextFile(filepath, true);
- fh.WriteLine(text);
- fh.Close();
- }
-
- , mkdirSync : function(path) {
- fso.CreateFolder(path)
- }
- , readFileSync : function(filepath){
- var objFileToRead = fso.OpenTextFile(filepath,1)
- var strFileText = objFileToRead.ReadAll()
- objFileToRead.Close()
- return strFileText
- }
- , unlinkSync : function(filepath){ fso.DeleteFile(filepath) }
- }
-
- var path = {
- resolve : function(path){ return fso.GetAbsolutePathName(path) }
- , dirname : function(filepath) {
- var normalized = this.normalize(filepath)
- var li = normalized.lastIndexOf("\\")
- if( li > -1) {
- return normalized.substring(0, li)
- }
- }
- , normalize : function(path){
- return path.replace(/\//g,'\\');
- }
- }
-
-
- var selectedinstance = { root : path.resolve(".") }
-
- var existsSyncFolder = function(path){
- return fso.FolderExists(path)
- }
-
- var shell = new ActiveXObject('shell.application');
-
- promises.forEach = forEach
- function startPromises(){
- promises.forEach(function(p){
-
- p.start();
-
- })
- }
-
- function batchshellescape(str) {
- return str.replace('=', '^=')
- }
-
- function nodeShellExec(command, cargs, options){
-
-
-
-
-
-
- var elevatedshellexecute = function(cmd, argstr){
- shell.ShellExecute(cmd, argstr , "", "", 1);
- }
-
- var shellExec = function(cmd, argstr){
-
- var objShell = WScript.createobject("wscript.shell")
-
- console.log(cmd + ' ' + argstr.join(' '))
- var oExec = objShell.Exec(cmd + ' ' + argstr.join(' '))
- var result = {}
- var shellresult = { shell : objShell, result : result }
-
- var WshRunning = 0
- var WshFinished = 1
- var WshFailed = 2
- while(oExec.Status === WshRunning){
- WScript.StdOut.write('s.')
- WScript.Sleep(500)
- }
- var strOutput = '\n'
- switch(oExec.Status) {
- case WshFinished :
- strOutput = oExec.StdOut.ReadAll()
- result.success = true;
- result.code = 0
- break;
- case WshFailed :
- strOutput = oExec.StdErr.ReadAll()
- result.success = false;
- result.code = WshFailed
- break;
- default : strOutput = 'failed'
- break;
- }
- result.result = command + ' ' + cargs + ' exited with code ' + result.code
- result.messages = [strOutput]
-
-
-
-
-
-
-
-
- objShell = null;
- return shellresult;
- }
-
- var p = null;
- var pworker = function(resolve, reject){
-
- var pfx = selectedinstance.root + '\\.elxr\\run-' + runtimestamp + '\\' + stampedFilePfx(new Date())
-
- options = options || {
- runFile : path.normalize( pfx + "out.txt")
-
- }
- var runFile = null;
- var runFile = options.runFile || pfx + command + cargs + "out.txt";
-
- var args = cargs.concat()
-
-
-
-
-
-
-
-
-
-
-
- var runbat = path.normalize(pfx + "run.bat")
-
- fs.writeFileSync(runbat,
- '@echo off \r\n' +
- (options.cwd ? 'cd ' + options.cwd + ' \r\n' : '') +
-
- command + ' ' + args.join(' ') + ' \r\n' +
- 'cmd /c echo done >> ' + runFile + ' \r\n' +
- 'echo done'
- )
-
-
-
-
-
-
-
-
-
-
-
-
- console.log(options.waitmsg || ('awaiting ' + command + ' ' + args.join(' ')))
- var shellresult = shellExec( 'cmd', [ '/c', runbat])
-
-
-
-
-
- var wrapup = function(result) {
-
- try {
-
-
-
-
- resolve(result)
- }
- catch(e){
-
- if(e.message === 'Input past end of file') {
-
-
- resolve(result)
- }
- else {
-
- reject(e)
- }
- }
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- console.log(shellresult.strOutput)
-
- wrapup(shellresult.result)
-
- }
- p = new Promise(pworker)
-
-
-
-
-
-
- return p;
- }
- createPromiseClass()
- __main( selectedinstance )
-
-
- function createPromiseClass(overrides) {
-
- function reject(e){
- var p = this;
- console.log('Promise Rejection : ' + p.fn)
- console.dir(e)
-
- if(p.state !== PromiseClass.PENDING) { console.error ('Error : Promise Rejection can only be called once')}
- var __i = 0;
- var __e = e;
- do {
- for(var i = __i; i < p.chain.length; i++, __i = i) if(p.chain[i].isCatch) break;
- try {
- for(var i = __i; i < p.chain.length; i++, __i = i) if(p.chain[i].isCatch) { p.chain[i](__e); break; }
- __i++;
- __e = null;
- }
- catch(e){ __i++; __e = e}
- } while(__e)
- do {
- try { for(var i = __i; i < p.chain.length; i++, __i = i) if(!p.chain[i].isCatch) { p.result = p.chain[i](p.result); } }
- catch(e){
- __i ++;
- do {
- try {
- for(var i = __i; i < p.chain.length; i++, __i = i) if(p.chain[i].isCatch) { p.chain[i](__e); break; }
- __i ++;
- __e = null;
- }
- catch(e){ __i++; __e = e}
- } while(__e)
- }
- } while ( __i < p.chain.length )
- p.state = PromiseClass.REJECTED;
- }
-
- function resolve(result){
- var p = this;
-
- if(p.state !== PromiseClass.PENDING) { console.error ('Error : Promise Resolve can only be called once')}
- p.result = result;
- if(PromiseClass.resolve(p.result) === p.result) {
-
- waitForResult(p.result, function(r){ p.processchain(r) })
- }
- else {
-
-
- return p.processchain(result)
- }
- };
-
- function processchain(r){
-
- var __i = 0;
- var i = __i;
- var __e = null;
- p = this;
-
-
- function __processchain(r){
-
- function waitForThen(p){
- if(i < p.chain.length) {
- if(!p.chain[i].isCatch) {
-
- try {
- p.result = p.chain[i](p.result)
-
- if(PromiseClass.resolve(p.result) === p.result) {
-
-
-
- p.result.start()
-
- waitForResult(p.result, function(r){
-
-
- p.result = r; i++; __i = i;
- waitForThen(p)
- })
- }
- else {
- i++; __i = i;
- waitForThen(p)
- }
- }
- catch(e) {
- i++; __i = i;
- __e = e;
- console.log('failed on index ' + __i + p.chain[__i-1] )
- console.dir(e)
- waitForCatch(p);
- }
- }
- else {
-
- i++; __i = i;
- waitForThen(p)
- }
- }
- else return p.state = PromiseClass.FULFILLED;
- }
- function waitForCatch(p) {
- if(i < p.chain.length) {
- if(p.chain[i].isCatch) {
- console.log('chain idx : ' + i + ' Executing : catch : ' + p.result + ' ' + p.chain[i])
- try {
- p.result = p.chain[i](__e);
-
- if(PromiseClass.resolve(p.result) === p.result) {
- p.result.start()
- waitForResult(p.result, function(r){
- p.result = r; i++; __i = i;
- })
- waitForThen(p)
- }
- else {
- p.result = r; i++; __i = i;
- waitForThen(p)
- }
- }
- catch(e){ i++; __i = i;; __e = e; waitForCatch(p) }
- }
- else {
- i++; __i = i;
- waitForCatch(p)
- }
- }
- else return p.state = PromiseClass.REJECTED
- }
- waitForThen(p);
- }
- __processchain(r)
- }
-
- var create = function(fn){
- var p = {
- then : function(thenfn){
-
- thenfn.isThen = true
-
- p.chain.push(thenfn)
- return p;
- }
- , 'catch' : function(catchfn) {
- catchfn.isCatch = true
- p.chain.push(catchfn)
- return p;
- }
- , start : function(){
- if(this.started) {
- console.error('Cannot start more than once...')
- return p
- };
- this.started = true;
- this.fn = fn;
- try { fn( function(r){
-
- p.resolve(r) } , function(r){ p.reject(r) } ) }
- catch(e){
-
-
-
-
-
- p.reject(e)
- }
- return p
- }
- , state : PromiseClass.PENDING
- , chain : []
- , reject : reject
- , resolve : resolve
- , processchain : processchain
- }
- p.chain.forEach = forEach;
- return p;
- }
-
- var PromiseClass = function(fn /*, donotstart */){
- var p = create(fn)
-
-
-
-
-
- return p
- }
-
- PromiseClass.PENDING = 1
- PromiseClass.FULFILLED = 2
- PromiseClass.REJECTED = 3
-
- PromiseClass.isSETTLED = function(p){ p.state === PromiseClass.FULFILLED || p.state === PromiseClass.REJECTED }
-
- PromiseClass.resolve = function(v){
- if(v && v.then) return v;
- var p = create(function(resolve, reject){
- resolve(v)
- });
-
-
-
- return p;
- }
-
- function waitForResult(p, cb){
- if(!p) return cb(p)
- if(p.state !== PromiseClass.PENDING) cb(p.result)
-
- if(p.runFile && false) {
- while(!existsSync(p.runFile) && p.state === PromiseClass.PENDING) {
- console.log('Waiting for ResultFle'); wait(cb, 500)
- }
- cb(p.result)
- }
- else {
-
-
- function waiter(){
-
- if(p.state === PromiseClass.PENDING) wait(waiter, 500);
- else return cb(p.result)
- }
- wait(waiter, 500)
-
- }
- }
-
- PromiseClass.all = any;
-
- PromiseClass.__all = function(arr){
- arr.forEach = forEach;
- var resultPs = [];
- var results = [];
- console.log('All : ' + arr.length)
- var pAll = new PromiseClass(function(resolve, reject){
-
- console.log('All started : ' + pAll)
-
-
- arr.forEach(function(p){
- if(!p.then) { var pfn = p;
- p = new PromiseClass(function(resolve, reject){
- try{
- resolve(pfn())
- }
- catch(e){
- reject(e)
- }
- })
- p.start()
- }
- else {
-
-
-
- }
- resultPs.push(p)
-
- })
-
-
- var allwaitr = function(){
- var allResolved = true
- console.log('resultPs : ' + resultPs.length)
- for(var rIdx =0; rIdx < resultPs.length; rIdx++ ){
-
- if(resultPs[rIdx]) {
- allResolved = false
- waitForResult(resultPs[rIdx], function(r){
- if(Promise.resolve(r) !== r) results[rIdx] = r; resultPs[rIdx] = null;
- })
- break;
- }
- }
- if(allResolved) {
-
-
- resolve(results)
- }
- else wait(allwaitr, 500)
- }
- wait(allwaitr, 500)
- })
-
-
- return pAll
- }
-
-
- Promise = PromiseClass;
- return PromiseClass;
- }
- }
-
- function __main( selectedinstance ){
- var downloadsdir = selectedinstance.root + '\\..\\Downloads';
-
- var callsheltask = function(args) {
-
- return function() { return nodeShellExec.apply(null, args) } }
-
- var instanceName = 'elixir'
- var reposerver = 'https://git.bbh.org.in';
- var gitUser = 'guest';
- var gitpassword = 'guest';
- var gitEmail = 'guest@bbh.org.in';
- var gitPreinstalled = true;
-
-
- var BUILD_VERSION = '[VI]Version: {version} - built on {date}[/VI]';
- function getVersion() { return BUILD_VERSION; }
- console.log(getVersion())
-
- function ensureDirectoryExistence(filePath) {
- var dirname = path.dirname(filePath);
- if (existsSyncFolder(dirname)) {
- return filePath;
- }
- ensureDirectoryExistence(dirname);
- fs.mkdirSync(dirname);
- return filePath;
- }
-
- var getTaskCheckExists = function(command, options) {
- options = options || {}
- return function() {
- var runFile = path.normalize(selectedinstance.root + '/.elxr/run-' + runtimestamp + '/' + stampedFilePfx(new Date()) + 'where' + command + "out.txt");
- var p = nodeShellExec.apply(null, ['cmd', ['/c', 'where', command], { runFile : runFile } ])
- p.runFile = runFile;
- if (options.ignorefailures) {
- return p.then(function(v) {
-
- return v })['catch']( function(e) {
- console.error(e);
-
- throw e;
- })
- }
- else return p.then(function() {
-
- return v });
- }
- }
-
- function verifyAndInstallPrerequisites() {
- fs.writeFileSync(ensureDirectoryExistence(downloadsdir + '/readme.txt'), getVersion() + ' Your local downloads for this instance');
- var downloadbatch =
- "::************************************************************************** \r\n \
- :Download_ <url> <File> \r\n \
- Powershell.exe ^\r\n \
- $AllProtocols = [System.Net.SecurityProtocolType]'Ssl3,Tls,Tls11,Tls12'; ^\r\n \
- [System.Net.ServicePointManager]::SecurityProtocol = $AllProtocols; ^\r\n \
- (New-Object System.Net.WebClient).DownloadFile('%1','%2') \r\n \
- exit /b \r\n \
- ::**************************************************************************";
- ensureDirectoryExistence(path.normalize(selectedinstance.root + '/.elxr/run-' + runtimestamp + '/readme.txt'))
- fs.writeFileSync(path.normalize(selectedinstance.root + '/.elxr/run-' + runtimestamp + '/download.bat'), downloadbatch);
-
- var downloadtasks = [];
- var installtasks = [];
- prerequisites.forEach(function(preq) {
- WScript.Echo(all)
- if(!all && preq.optional) return
- var p = preq.exists().then(function(exists) {
- if (exists && !preq.forceinstall) console.log( preq.shellcmd + ' exists');
- else {
- console.log('----------------------------')
- console.log(exists)
- console.log('----------------------------')
- if(!exists) console.log(preq.shellcmd + ' is not installed');
- else console.log(preq.shellcmd + ' is installed but forceinstall was specifed so re-installing');
- return preq.preinstallsteps().then(function(){
-
- installtasks.push( function(){ return preq.install() } );
- })
- }
- })
-
- downloadtasks.push( p )
- });
-
-
- var p = Promise.all(downloadtasks).then(function(){
-
- return any(installtasks) })
-
-
- return p
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- function exists(next){
- var self = this;
- console.log('checking existence of ' + self.shellcmd)
- return getTaskCheckExists(self.shellcmd, { ignorefailures: true })().then(function(exists) {
-
-
-
-
-
- if(exists && (exists.messages.join(' ').indexOf(self.shellcmd) > -1) ) {
- return true;
- }
- else return false
- })['catch'](function(e){
-
- console.dir(e)
- return false;
- })
- }
-
- function install() {
- 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 && self.postinstallsteps()
- })
- }
-
- function unique(arr) {
- var hash = {}, result = [];
- for ( var i = 0, l = arr.length; i < l; ++i ) {
- if ( !hash.hasOwnProperty(arr[i]) ) {
- hash[ arr[i] ] = true;
- result.push(arr[i]);
- }
- }
- return result;
- }
-
-
-
- function sysAddPathVar(path){
-
- return true;
-
-
-
-
-
-
-
- var newpath = [];
- newpath.push(path)
- newpath = unique(newpath).join(';')
-
- return any([nodeShellExec('setx', [ 'PATH', '"%PATH%;' + newpath + '"' ])
-
- ] );
- }
-
- var getCmdString = function(args){ return args[0] + ' ' + args[1].join(' ') }
-
- var getgitshelltask = function(args, onEachError) { return function(){
- console.log('----------getgitshelltask--------------called')
- return nodeShellExec( "cmd", ['/c', getCmdString(args)], args[2])
-
- }
- }
-
-
- var createTasq = function(args, shellT, onEachError) {
- var tasq = shellT ? shellT(args) : ( function(){
- return any([nodeShellExec.apply(null, args)])
-
- })
- tasq.toString = function(){ return JSON.stringify(args)}
- return tasq;
- }
-
- var execserial = function(tasklist, task, shellT, onEachError){
- var exec = function(taskArgs){
- console.log('executing ' + task)
- var thistask = task.concat();
- thistask[1] = thistask[1].concat()
- thistask[1].push.apply(thistask[1], taskArgs)
- return createTasq(thistask, shellT)
- }
-
- tasklist.map = map
- console.log('execlist ' + tasklist.map(exec))
- return any(tasklist.map(exec))
- }
-
- function resetgitconfig(){
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- var options = {
- inherit: true, shell: true
- , cwd: selectedinstance.root
-
- }
-
- var task = ['git', ['config'], options]
-
- var tasklist = [
-
-
-
-
- ['--global', 'credential.helper', '"store --file ~/.elxrcredentials"']
- , ['--global', '--replace-all', 'user.name', gitUser]
- , ['--global', '--replace-all', 'user.email', gitEmail]
-
-
-
- ]
- console.log(tasklist)
- var onEachError = function(e) { console.error( e.messages.join('\n') + e.result + '\n' + util.inspect(e) + '\n') }
- var shellT = function(args) {
- return getgitshelltask(args, onEachError)
-
- }
- return execserial(tasklist, task, shellT, onEachError ).then(function(){
-
- console.log('gathering git credentials')
- var userhome = '~'
- if(isWin()) userhome = '%userprofile%'
- var host = reposerver.replace('https://','').replace('http://','')
- var protocol = reposerver.replace('https://','') === host ? 'https' : 'http'
- fs.writeFileSync('ic.txt', 'host='+host+'\r\nprotocol='+protocol+'\r\nusername='+gitUser+'\r\npassword='+gitpassword)
- return nodeShellExec('git', ['credential-store', '--file', userhome + '/.elxrcredentials', 'store', '<', 'ic.txt'], options)
- })
- }
-
- var gitpostinstallsteps = function(){
-
- try {
-
- var icf = fs.readFileSync( 'installchoices.js')
- icf = icf.replace('module.exports = ', 'icf = ')
- console.log(icf)
- icf = eval(icf)
-
- instanceName = icf.instanceName
- reposerver = icf.reposerver;
- gitUser = icf.gitUser;
- gitEmail = icf.gitEmail
- }
- catch(e) {
- console.error(e)
- }
-
-
-
-
- var steps = [];
- steps.push(
- function(){
- var choices = { 0 : 'elixir' }
- return cli.prompt(choices, 'instanceName', instanceName).then(function(choice){ instanceName = choice } )
- }
- )
- steps.push(
- function(){
- var choices = { 0 : 'https://git.bbh.org.in' }
- return cli.prompt(choices, 'reposerver', reposerver).then(function(choice){ reposerver = choice } )
- }
- )
- steps.push(
- function(){
- var choices = { 0 : 'guest', 1 : 'chessdemo' }
- return cli.prompt(choices, 'git user name', gitUser).then(function(choice){ gitUser = choice } )
- }
- )
- steps.push(
- function(){
- var choices = { }
- return cli.prompt(choices, 'git password', gitpassword).then(function(choice){ gitpassword = choice } )
- }
- )
- steps.push(
- function(){
- var choices = { 0 : 'guest@bbh.org.in', 1 : 'chessdemo@bbh.org.in' }
- return cli.prompt(choices, 'git user email', gitEmail).then(function(choice){ gitEmail = choice })
- }
- )
-
- return any(steps).then(function(){
-
-
- fs.writeFileSync( 'installchoices.js', 'module.exports = { instanceName : "'+ instanceName +'", reposerver: "'+reposerver+'", gitUser: "'+gitUser+'", gitEmail:"'+gitEmail+'" }' )
-
- var steps = [
-
-
- ]
-
- if(!steps.map) steps.map = map;
- return any(steps.map(callsheltask)).then(function(){
-
- })
- });
- }
-
- var prerequisites = [
- {
- shellcmd: 'git',
- url: 'https://github.com/git-for-windows/git/releases/download/v2.33.0.windows.2/Git-2.33.0.2-64-bit.exe'
- , installer: 'Git-2.33.0.2-64-bit.exe'
- , installcmd: ['cmd', ['/c', 'start',
- '/WAIT', downloadsdir + '/' + 'Git-2.33.0.2-64-bit.exe'
- , '/VERYSILENT'
-
- ]]
- , preinstallsteps: function() {
- var self = this;
- console.log('Git preinstall steps')
-
- var steps = [];
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- steps.push(
- function(){
- if (!existsSync(downloadsdir + '/' + self.installer)) {
- return nodeShellExec(selectedinstance.root + '/.elxr/run-' + runtimestamp + '/download.bat', [self.url, downloadsdir + '/' + self.installer])
- }
- else {
- console.log(self.installer + ' Already exits Download skipped.')
- return Promise.resolve(true)
- }
- }
- )
- return any(steps)
-
- }
- , installsteps: function () {
- var self = this;
- console.log('Git Installsteps called')
- var ifns = [self.installcmd]
- if(!ifns.map) ifns.map = map;
- return any(ifns.map(callsheltask))['catch'](function(e){
- if(e.code === 1602) {
- console.warn("Installation was probably cancelled.")
- }
- else throw e
- })
- }
- , postinstallsteps: gitpostinstallsteps
- , install: function () {
- gitPreinstalled = false;
- var self = this;
- console.log('Git Install called')
-
- return any([
- function(){ return self.installsteps() }
- , function() { return resetgitconfig() }
- , function(){ return self.postinstallsteps() }
- ])
- }
-
-
-
-
-
-
-
- , exists : exists
- , getUser : function(repo, onNoResult){
-
-
- onNoResult = onNoResult || function(){return false}
- var globalOrLocal = '--global';
- if(!repo) globalOrLocal = '--global';
- else globalOrLocal = '--local'
- var fns = [['git', ['config', globalOrLocal, '--get-all', 'user.name']]]
- if(!ifns.map) ifns.map = map;
- return any(fns.map(callsheltask)).then(function(result){
-
- if(!result.success) return onNoResult()
- else {
- var users = result.messages[0].trim().split('\n');
- if(users.length === 0 ||
- users.length === 1 && users[0] === 'guest') {
-
- return onNoResult()
- }
- else return users[0];
- }
- })
- ['catch'](function(e){
- console.log(e)
- return onNoResult()
- })
- }
- }
- ,
- {
- shellcmd: 'node',
- url: 'https://nodejs.org/dist/v14.17.6/node-v14.17.6-x64.msi'
- , installer: 'node-v14.17.3-x64.msi'
- , installcmd: ['MSIEXEC.exe', ['/i'
- , path.normalize(downloadsdir + '/' + 'node-v14.17.3-x64.msi')
- , 'ACCEPT=YES', '/passive']]
- , install : install
- , exists : exists
- , preinstallsteps: function() {
- var self = this;
- console.log('Node preinstall steps')
-
- var steps = [];
- steps.push(
- function(){
- if (!existsSync(downloadsdir + '/' + self.installer)) {
- return nodeShellExec(selectedinstance.root + '/.elxr/run-' + runtimestamp + '/download.bat', ['"' + self.url + '"', downloadsdir + '/' + self.installer]
- , { waitmsg : 'downloading '+ self.shellcmd +' please wait' })
- }
- else {
- console.log(self.installer + ' Already exits Download skipped.')
- return Promise.resolve(true)
- }
- }
- )
-
- return any(steps)
-
- }
- }
- , {
- shellcmd: 'python'
- , optional : true
- , 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() {
- var self = this;
- console.log(self.shellcmd + ' preinstall steps')
-
- var steps = [];
- steps.push(
- function(){
- if (!existsSync(downloadsdir + '/' + self.installer)) {
- return nodeShellExec(selectedinstance.root + '/.elxr/run-' + runtimestamp + '/download.bat', [self.url, downloadsdir + '/' + self.installer]
- , { waitmsg : 'downloading '+ self.shellcmd +' please wait' })
- }
- else {
- console.log(self.installer + ' Already exits Download skipped.')
- return Promise.resolve(true)
- }
- }
- )
-
- return any(steps)
-
- }
- , install : install
- , postinstallsteps : function() { return sysAddPathVar('%USERPROFILE%\\AppData/Local\\Microsoft\\WindowsApps') }
- , exists : exists
- }
- , {
- shellcmd: 'code'
- , optional : true
- , url: 'https://code.visualstudio.com/sha/download?build=stable&os=win32-x64-user'
- , installer: 'VSCodeUserSetup-x64-1.65.2.exe'
- , installcmd: ['cmd /c', ['start /WAIT ' + downloadsdir + '/' + 'VSCodeUserSetup-x64-1.65.2.exe /VERYSILENT'
-
- ]]
- , preinstallsteps: function() {
- var self = this;
- console.log(self.shellcmd + ' preinstall steps')
-
- var steps = [];
- steps.push(
- function(){
- if (!existsSync(downloadsdir + '/' + self.installer)) {
- console.log(self.url)
- return nodeShellExec(selectedinstance.root + '/.elxr/run-' + runtimestamp + '/download.bat', ['"' + self.url + '"', downloadsdir + '/' + self.installer]
- , { waitmsg : 'downloading '+ self.shellcmd +' please wait' })
- }
- else {
- console.log(self.installer + ' Already exits Download skipped.')
- return Promise.resolve(true)
- }
- }
- )
-
- return any(steps)
-
- }
- , install : install
- , postinstallsteps : function() { return sysAddPathVar('%USERPROFILE%\\AppData/Local\\Microsoft\\WindowsApps') }
- , exists : exists
- }
- , {
-
-
- shellcmd: 'Ssms.exe',
- url: 'https://aka.ms/ssmsfullsetup'
- , installer: 'SSMS-Setup-ENU.exe'
- , installcmd: ['cmd', ['/c', 'start',
- '/WAIT', downloadsdir + '/' + 'SSMS-Setup-ENU.exe'
- , '/IAcceptSQLServerLicenseTerms'
-
- ]]
- , install : install
- , exists : function(){
- var self = this;
- var installedpath = 'C:\\Program Files (x86)\\Microsoft SQL Server Management Studio 18\\Common7\\IDE\\Ssms.exe'
- console.log('checking existence of ' + installedpath)
- return Promise.resolve(existsSync(installedpath))
- }
- , preinstallsteps: function() {
- var self = this;
- console.log('smss 2018 preinstall steps')
-
- var steps = [];
- steps.push(
- function(){
- if (!existsSync(downloadsdir + '/' + self.installer)) {
- console.log(self.url)
- return nodeShellExec(selectedinstance.root + '/.elxr/run-' + runtimestamp + '/download.bat', ['"' + self.url + '"', downloadsdir + '/' + self.installer]
- , { waitmsg : 'downloading '+ self.shellcmd +' please wait' })
- }
- else {
- console.log(self.installer + ' Already exits Download skipped.')
- return Promise.resolve(true)
- }
- }
- )
-
- return any(steps)
-
- }
- }
- , {
-
- shellcmd: 'Ssms.exe',
- url: 'https://go.microsoft.com/fwlink/?linkid=2043154&clcid=0x409'
- , installer: 'SSMS-Setup-ENU-2017.exe'
- , installcmd: ['cmd', ['/c', 'start',
- '/WAIT', downloadsdir + '/' + 'SSMS-Setup-ENU-2017.exe'
- , '/IAcceptSQLServerLicenseTerms'
-
- ]]
- , install : install
- , exists : function(){
- return Promise.resolve(false)
- var self = this;
-
- var installedpath = 'C:\\Program Files (x86)\\Microsoft SQL Server\\140\\Tools\\Binn\\ManagementStudio\\Ssms.exe'
- console.log('checking existence of ' + installedpath)
- return Promise.resolve(existsSync(installedpath))
- }
- , preinstallsteps: function() {
- var self = this;
- console.log('smss preinstall steps')
-
- var steps = [];
- steps.push(
- function(){
- if (!existsSync(downloadsdir + '/' + self.installer)) {
- console.log(self.url)
- return nodeShellExec(selectedinstance.root + '/.elxr/run-' + runtimestamp + '/download.bat', ['"' + self.url + '"', downloadsdir + '/' + self.installer]
- , { waitmsg : 'downloading '+ self.shellcmd +' please wait' })
- }
- else {
- console.log(self.installer + ' Already exits Download skipped.')
- return Promise.resolve(true)
- }
- }
- )
-
- return any(steps)
-
- }
- }
- , {
- shellcmd: 'sqlservr.exe',
- url: 'https://go.microsoft.com/fwlink/?linkid=866658'
- , installer: 'SQL2019-SSEI-Expr.exe'
- , installcmd: ['cmd', ['/c', 'start',
- '/WAIT', downloadsdir + '/' + 'SQL2019-SSEI-Expr.exe'
- , ''
-
- ]]
- , install : install
- , exists : function(){
- var self = this;
- var installedpath = 'C:\\Program Files\\Microsoft SQL Server\\MSSQL15.SQLEXPRESS\\MSSQL\\Binn\\sqlservr.exe'
- console.log('checking existence of ' + installedpath)
- return Promise.resolve(existsSync(installedpath))
- }
- , preinstallsteps: function() {
- var self = this;
- console.log('sqlexpress preinstall steps')
-
- var steps = [];
- steps.push(
- function(){
- if (!existsSync(downloadsdir + '/' + self.installer)) {
- console.log(self.url)
- return nodeShellExec(selectedinstance.root + '/.elxr/run-' + runtimestamp + '/download.bat', ['"' + self.url + '"', downloadsdir + '/' + self.installer]
- , { waitmsg : 'downloading '+ self.shellcmd +' please wait' })
- }
- else {
- console.log(self.installer + ' Already exits Download skipped.')
- return Promise.resolve(true)
- }
- }
- )
-
- return any(steps)
-
- }
- }
- , {
- shellcmd: 'mysql',
- url: 'https://dev.mysql.com/get/Downloads/MySQLInstaller/mysql-installer-community-8.0.30.0.msi'
- , installer: 'mysql-installer-community-8.0.30.0.msi'
- , installcmd: ['MSIEXEC.exe', ['/i'
- , path.normalize(downloadsdir + '/' + 'mysql-installer-community-8.0.30.0.msi')
-
- ]]
- , install : install
- , exists : function(){
- var self = this;
- var mysqldpath = 'C:\\Program Files\\MySQL\\MySQL Server 8.0\\bin\\mysqld.exe'
- console.log('checking existence of ' + mysqldpath)
- return Promise.resolve(existsSync(mysqldpath))
- }
- , preinstallsteps: function() {
- var self = this;
- console.log('mysql preinstall steps')
-
- var steps = [];
- steps.push(
- function(){
- if (!existsSync(downloadsdir + '/' + self.installer)) {
- console.log(self.url)
- return nodeShellExec(selectedinstance.root + '/.elxr/run-' + runtimestamp + '/download.bat', [self.url, downloadsdir + '/' + self.installer]
- , { waitmsg : 'downloading '+ self.shellcmd +' please wait' })
- }
- else {
- console.log(self.installer + ' Already exits Download skipped.')
- return Promise.resolve(true)
- }
- }
- )
-
- return any(steps)
-
- }
- }
- ,
- {
- shellcmd: 'elxr'
- , forceinstall : true
- , installcmd: [ isWin() ? 'npm.cmd' : 'npm' , ['link'], { cwd : selectedinstance.root + '\\elxr' }]
- , preinstallsteps: function() {
- var self = this;
- console.log('Elxr preinstall steps')
-
- var steps = [];
- steps.push(
-
- )
- return any([any(steps)])
- }
- , installsteps: function () {
- var self = this;
- console.log('GIt config reconfirm called ' + gitPreinstalled)
- var installIfNotExists = function(){
- var steps = [];
- if(gitPreinstalled) {
- console.log('-------------------------------------')
- console.log('Git was already preinstalled - reconfirming installchoices')
-
-
-
-
- try {
- var icf = fs.readFileSync( 'installchoices.js')
- icf = icf.replace('module.exports = ', 'icf = ')
- console.log(icf)
- icf = eval(icf)
-
- instanceName = icf.instanceName
- reposerver = icf.reposerver;
- gitUser = icf.gitUser;
- gitEmail = icf.gitEmail
- }
- catch(e) {
- console.error(e)
- }
-
-
- console.log('-------------------------------------')
- console.dir(icf)
-
- steps.push(gitpostinstallsteps)
-
-
-
-
-
-
-
-
- }
- else{
-
- steps.push(
- function(){
- var choices = { }
- return cli.prompt(choices, 'git password', gitpassword).then(function(choice){ gitpassword = choice } )
- }
- )
- }
-
-
-
- return any(steps).then( function(){
- console.log('calling resetgitconfig')
- return resetgitconfig().then(function(){
- console.log('cloning elxr now')
- var ifns = [
- ['git', ['clone', reposerver + '/chess/elxr'] ]
- ]
- if(existsSyncFolder( selectedinstance.root + '\\elxr')) {
- if(existsSyncFolder( selectedinstance.root + '\\elxr\\.git')) {
-
- ifns = [ ['git', ['pull'], { cwd : selectedinstance.root + '\\elxr' } ] ]
- }
- else {
- throw 'elxr subfolder not recognized as a git repository. Please cleanup and continue.'
- }
- }
- else console.log(selectedinstance.root + '\\elxr' + ' NOT FOUND ')
-
- if(!ifns.map) ifns.map = map;
- return any(ifns.map(callsheltask)).then(function(){
- var pkgjson = selectedinstance.root + '\\elxr\\package.json'
- var pkgcontents = fs.readFileSync(pkgjson)
-
- fs.writeFileSync( pkgjson, pkgcontents.replace(/http\:\/\/git\.bbh/g, reposerver));
- return callsheltask(['npm', ['i'], { cwd : '.\\elxr' } ])
- })['catch'](function(e){
- if(e.code === 1602) {
- console.warn("Installation was probably cancelled.")
- }
- else throw e
- })
-
- })
- } )
- }
- var ifns = [ self.installcmd ]
- if(!ifns.map) ifns.map = map;
- return installIfNotExists().then(function(){
- return any(ifns.map(callsheltask))['catch'](function(e){
- if(e.code === 1602) {
- console.warn("Installation was probably cancelled.")
- }
- else throw e
- })
- })
- }
- , install: function () {
- var self = this;
- console.log('Elxr Install called')
-
-
- fs.writeFileSync(selectedinstance.root + '\\ei.bat', 'cmd /c node ' + selectedinstance.root + '\\elxr\\index.js i ' + instanceName)
-
- return any([ self.preinstallsteps, function(){ return self.installsteps() }
- , nodeShellExec('start', ['/WAIT', '""', '"' + selectedinstance.root + '\\ei.bat' + '"'])
-
-
- ])
-
-
-
-
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- , exists : exists
-
- }
- ]
-
- if(!prerequisites.forEach) prerequisites.forEach = forEach;
-
-
-
-
- promises.push(verifyAndInstallPrerequisites())
-
- startPromises();
- }
|