|
|
|
@ -527,7 +527,16 @@ install.save = async function (server_conf) {
|
|
|
|
|
serverConfigPath = path.resolve(__dirname, '../', nconf.get('config'));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
await fs.promises.writeFile(serverConfigPath, JSON.stringify(server_conf, null, 4));
|
|
|
|
|
let currentConfig = {};
|
|
|
|
|
try {
|
|
|
|
|
currentConfig = require(serverConfigPath);
|
|
|
|
|
} catch (err) {
|
|
|
|
|
if (err.code !== 'MODULE_NOT_FOUND') {
|
|
|
|
|
throw err;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
await fs.promises.writeFile(serverConfigPath, JSON.stringify({ ...currentConfig, ...server_conf }, null, 4));
|
|
|
|
|
console.log('Configuration Saved OK');
|
|
|
|
|
nconf.file({
|
|
|
|
|
file: serverConfigPath,
|
|
|
|
|