|
|
@@ -36,6 +36,15 @@ 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. |
|
|
|
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) => { |
|
|
|
options = options || {} |
|
|
|
return () => { |
|
|
@@ -204,7 +213,13 @@ var configPromise = null |
|
|
|
|
|
|
|
// elxr cli operations |
|
|
|
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(); } |
|
|
|
, 'reset': () => { |
|
|
|
|
|
|
@@ -471,14 +486,6 @@ var op = { |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
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) |
|
|
|
} |
|
|
|
, 'add': (remotename, url, branch) => { |
|
|
@@ -788,6 +795,8 @@ var op = { |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
// 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( |
|
|
|
// () => { |
|
|
|
// console.log(`--------------------second time npm i for client--------------------`) |
|
|
@@ -1432,7 +1441,7 @@ var detectInstance = function () { |
|
|
|
// Built version. |
|
|
|
// check if we have a elxr subfolder. |
|
|
|
if (fs.existsSync(launchpath + '/..' + path.normalize('/elxr'))) { |
|
|
|
// Probably in the right place. |
|
|
|
// Probably in the right place. |
|
|
|
root = path.normalize(launchpath + '/..'); |
|
|
|
} |
|
|
|
else { |
|
|
@@ -1611,8 +1620,8 @@ var maintask = () => { |
|
|
|
} |
|
|
|
catch (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 { |
|
|
|
|