From 55aa66cebf717ad2b9f3ef34841a57890cda87c9 Mon Sep 17 00:00:00 2001 From: Ylian Saint-Hilaire Date: Fri, 12 Jun 2020 12:39:51 -0700 Subject: [PATCH] Meshctrl.js improvement to find config.json --- meshctrl.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/meshctrl.js b/meshctrl.js index 969e90c2..0820e06a 100644 --- a/meshctrl.js +++ b/meshctrl.js @@ -445,9 +445,10 @@ function performConfigOperations(args) { var configChange = false; var fs = require('fs'); var path = require('path'); - var configFile = path.join(__dirname, 'config.json'); + var configFile = 'config.json'; var didSomething = 0; if (fs.existsSync(configFile) == false) { configFile = path.join('meshcentral-data', 'config.json'); } + if (fs.existsSync(configFile) == false) { configFile = path.join(__dirname, 'config.json'); } if (fs.existsSync(configFile) == false) { configFile = path.join(__dirname, 'meshcentral-data', 'config.json'); } if (fs.existsSync(configFile) == false) { configFile = path.join(__dirname, '..', 'meshcentral-data', 'config.json'); } if (fs.existsSync(configFile) == false) { console.log("Unable to find config.json."); return; }