| 
														 | 
														 | 
														 | 
														 | 
														 | 
													
													
												
													
														 | 
														 | 
														
  | 
														 | 
														 | 
														
  | 
													
													
												
													
														 | 
														 | 
														var ENV = Object.assign({}, process.env); // Shallow clone it. | 
														 | 
														 | 
														var ENV = Object.assign({}, process.env); // Shallow clone it. | 
													
													
												
													
														 | 
														 | 
														
  | 
														 | 
														 | 
														
  | 
													
													
												
													
														 | 
														 | 
														 | 
														 | 
														 | 
														const { readdir } = require("fs").promises | 
													
													
												
													
														 | 
														 | 
														 | 
														 | 
														 | 
														
  | 
													
													
												
													
														 | 
														 | 
														 | 
														 | 
														 | 
														// Directory shallow walk and do perform on each dir. | 
													
													
												
													
														 | 
														 | 
														 | 
														 | 
														 | 
														const dirs = async (perform, path) => { | 
													
													
												
													
														 | 
														 | 
														 | 
														 | 
														 | 
														  for (const dir of await readdir(path || process.cwd(), { withFileTypes: true })) { | 
													
													
												
													
														 | 
														 | 
														 | 
														 | 
														 | 
														    if (dir.isDirectory()) perform(dir) | 
													
													
												
													
														 | 
														 | 
														 | 
														 | 
														 | 
														  } | 
													
													
												
													
														 | 
														 | 
														 | 
														 | 
														 | 
														} | 
													
													
												
													
														 | 
														 | 
														 | 
														 | 
														 | 
														
  | 
													
													
												
													
														 | 
														 | 
														var getShellTask = (command, args, options) => { | 
														 | 
														 | 
														var getShellTask = (command, args, options) => { | 
													
													
												
													
														 | 
														 | 
														  options = options || {} | 
														 | 
														 | 
														  options = options || {} | 
													
													
												
													
														 | 
														 | 
														  return () => { | 
														 | 
														 | 
														  return () => { | 
													
													
												
											
												
													
														 | 
														 | 
														 | 
														 | 
														 | 
														 | 
													
													
												
													
														 | 
														 | 
														
  | 
														 | 
														 | 
														
  | 
													
													
												
													
														 | 
														 | 
														// elxr cli operations | 
														 | 
														 | 
														// elxr cli operations | 
													
													
												
													
														 | 
														 | 
														var op = { | 
														 | 
														 | 
														var op = { | 
													
													
												
													
														 | 
														 | 
														  'h': () => { console.log(elxr.info()); return '-h' } | 
														 | 
														 | 
														 | 
													
													
												
													
														 | 
														 | 
														 | 
														 | 
														 | 
														  'h': () => { console.log(elxr.help()); return '-h' } | 
													
													
												
													
														 | 
														 | 
														 | 
														 | 
														 | 
														  , 'clean' : () => { | 
													
													
												
													
														 | 
														 | 
														 | 
														 | 
														 | 
														    // delete all node_module folders and links. | 
													
													
												
													
														 | 
														 | 
														 | 
														 | 
														 | 
														    var tasklist = []; | 
													
													
												
													
														 | 
														 | 
														 | 
														 | 
														 | 
														    dirs( (repodir)=> tasklist.push(getShellTask('rm',['-rf', 'node_modules'], { cwd : instanceroot + '/' + repodir.name })()), instanceroot ) | 
													
													
												
													
														 | 
														 | 
														 | 
														 | 
														 | 
														    return Promise.all(tasklist) | 
													
													
												
													
														 | 
														 | 
														 | 
														 | 
														 | 
														  } | 
													
													
												
													
														 | 
														 | 
														  , 'undefined': () => { return op.h(); } | 
														 | 
														 | 
														  , 'undefined': () => { return op.h(); } | 
													
													
												
													
														 | 
														 | 
														  , 'reset': () => { | 
														 | 
														 | 
														  , 'reset': () => { | 
													
													
												
													
														 | 
														 | 
														
  | 
														 | 
														 | 
														
  | 
													
													
												
											
												
													
														 | 
														 | 
														 | 
														 | 
														 | 
														 | 
													
													
												
													
														 | 
														 | 
														      }) | 
														 | 
														 | 
														      }) | 
													
													
												
													
														 | 
														 | 
														    } | 
														 | 
														 | 
														    } | 
													
													
												
													
														 | 
														 | 
														
  | 
														 | 
														 | 
														
  | 
													
													
												
													
														 | 
														 | 
														    const { readdir } = require("fs").promises | 
														 | 
														 | 
														 | 
													
													
												
													
														 | 
														 | 
														
  | 
														 | 
														 | 
														 | 
													
													
												
													
														 | 
														 | 
														    const dirs = async (perform, path) => { | 
														 | 
														 | 
														 | 
													
													
												
													
														 | 
														 | 
														      for (const dir of await readdir(path || process.cwd(), { withFileTypes: true })) { | 
														 | 
														 | 
														 | 
													
													
												
													
														 | 
														 | 
														        if (dir.isDirectory()) perform(dir) | 
														 | 
														 | 
														 | 
													
													
												
													
														 | 
														 | 
														      } | 
														 | 
														 | 
														 | 
													
													
												
													
														 | 
														 | 
														    } | 
														 | 
														 | 
														 | 
													
													
												
													
														 | 
														 | 
														
  | 
														 | 
														 | 
														 | 
													
													
												
													
														 | 
														 | 
														    dirs(perform_git_seturl) | 
														 | 
														 | 
														    dirs(perform_git_seturl) | 
													
													
												
													
														 | 
														 | 
														  } | 
														 | 
														 | 
														  } | 
													
													
												
													
														 | 
														 | 
														  , 'add': (remotename, url, branch) => { | 
														 | 
														 | 
														  , 'add': (remotename, url, branch) => { | 
													
													
												
											
												
													
														 | 
														 | 
														 | 
														 | 
														 | 
														 | 
													
													
												
													
														 | 
														 | 
														      }) | 
														 | 
														 | 
														      }) | 
													
													
												
													
														 | 
														 | 
														
  | 
														 | 
														 | 
														
  | 
													
													
												
													
														 | 
														 | 
														
  | 
														 | 
														 | 
														
  | 
													
													
												
													
														 | 
														 | 
														 | 
														 | 
														 | 
														      // PB : TODO -- npm i for client is for some reason not complete so bower doesn't get installed !!! | 
													
													
												
													
														 | 
														 | 
														 | 
														 | 
														 | 
														      // Second time try also doesnt work. | 
													
													
												
													
														 | 
														 | 
														      // repotasks.push( | 
														 | 
														 | 
														      // repotasks.push( | 
													
													
												
													
														 | 
														 | 
														      //   () => { | 
														 | 
														 | 
														      //   () => { | 
													
													
												
													
														 | 
														 | 
														      //     console.log(`--------------------second time npm i for client--------------------`) | 
														 | 
														 | 
														      //     console.log(`--------------------second time npm i for client--------------------`) | 
													
													
												
											
												
													
														 | 
														 | 
														 | 
														 | 
														 | 
														 | 
													
													
												
													
														 | 
														 | 
														        // Built version. | 
														 | 
														 | 
														        // Built version. | 
													
													
												
													
														 | 
														 | 
														        // check if we have a elxr subfolder. | 
														 | 
														 | 
														        // check if we have a elxr subfolder. | 
													
													
												
													
														 | 
														 | 
														        if (fs.existsSync(launchpath + '/..' + path.normalize('/elxr'))) { | 
														 | 
														 | 
														        if (fs.existsSync(launchpath + '/..' + path.normalize('/elxr'))) { | 
													
													
												
													
														 | 
														 | 
														          // Probably in the right place. | 
														 | 
														 | 
														 | 
													
													
												
													
														 | 
														 | 
														 | 
														 | 
														 | 
														          // Probably in the right place.         | 
													
													
												
													
														 | 
														 | 
														          root = path.normalize(launchpath + '/..'); | 
														 | 
														 | 
														          root = path.normalize(launchpath + '/..'); | 
													
													
												
													
														 | 
														 | 
														        } | 
														 | 
														 | 
														        } | 
													
													
												
													
														 | 
														 | 
														        else { | 
														 | 
														 | 
														        else { | 
													
													
												
											
												
													
														 | 
														 | 
														 | 
														 | 
														 | 
														 | 
													
													
												
													
														 | 
														 | 
														      } | 
														 | 
														 | 
														      } | 
													
													
												
													
														 | 
														 | 
														      catch (e) { | 
														 | 
														 | 
														      catch (e) { | 
													
													
												
													
														 | 
														 | 
														        console.error(e) | 
														 | 
														 | 
														        console.error(e) | 
													
													
												
													
														 | 
														 | 
														        console.error('No local instances found in current root = ' + selectedinstance.root); | 
														 | 
														 | 
														 | 
													
													
												
													
														 | 
														 | 
														        console.log('We will create a new one with the instance and environment chosen...') | 
														 | 
														 | 
														 | 
													
													
												
													
														 | 
														 | 
														 | 
														 | 
														 | 
														        console.error('No local instances config found in current root = ' + selectedinstance.root); | 
													
													
												
													
														 | 
														 | 
														 | 
														 | 
														 | 
														        console.log('A config will be createed with the instance and environment chosen...') | 
													
													
												
													
														 | 
														 | 
														      } | 
														 | 
														 | 
														      } | 
													
													
												
													
														 | 
														 | 
														      finally { | 
														 | 
														 | 
														      finally { | 
													
													
												
													
														 | 
														 | 
														         | 
														 | 
														 | 
														         |