mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2024-12-27 07:35:53 -05:00
Improved working directory switch.
This commit is contained in:
parent
92dd68f2ed
commit
9b239893f7
@ -2281,9 +2281,8 @@ function mainStart() {
|
|||||||
// Check the NodeJS is version 6 or better.
|
// Check the NodeJS is version 6 or better.
|
||||||
if (Number(process.version.match(/^v(\d+\.\d+)/)[1]) < 6) { console.log("MeshCentral requires Node v6 or above, current version is " + process.version + "."); return; }
|
if (Number(process.version.match(/^v(\d+\.\d+)/)[1]) < 6) { console.log("MeshCentral requires Node v6 or above, current version is " + process.version + "."); return; }
|
||||||
|
|
||||||
// If running within the node_modules folder, move working directory back to parent.
|
// If running within the node_modules folder, move working directory to the parent of the node_modules folder.
|
||||||
if (process.cwd().endsWith('\\node_modules\\meshcentral') || process.cwd().endsWith('/node_modules/meshcentral')) { process.chdir(require('path').join(process.cwd(), '..', '..')); }
|
if (__dirname.endsWith('\\node_modules\\meshcentral') || __dirname.endsWith('/node_modules/meshcentral')) { process.chdir(require('path').join(__dirname, '..', '..')); }
|
||||||
if (process.cwd().endsWith('\\node_modules') || process.cwd().endsWith('/node_modules')) { process.chdir(require('path').join(process.cwd(), '..')); }
|
|
||||||
|
|
||||||
// Check for any missing modules.
|
// Check for any missing modules.
|
||||||
InstallModules(['minimist'], function () {
|
InstallModules(['minimist'], function () {
|
||||||
|
Loading…
Reference in New Issue
Block a user