Enable and disable plugins from the commandline (non functional as of yet)

This commit is contained in:
Daniel Vestøl committed 2018-08-15 23:15:01 +02:00
1 parent e71c183b48
commit a76e07c07b
4 files changed
+76 -12

No files matched your search

+14 -4
View File
@@ -36,8 +36,8 @@ module.exports.editConfig = function(instance, entry, newValue){
if(objectOps.isJSON(newValue)){
config[entry] = JSON.parse(newValue);
console.log("Changed config entry "+entry+" from "+JSON.stringify(config[entry])+" to "+JSON.stringify(newValue));
console.log("new config file:");
console.log(JSON.stringify(config, null, " "))
// console.log("new config file:");
// console.log(JSON.stringify(config, null, " "))
fs.writeFileSync("config.json", JSON.stringify(config, null, 4));
return {
ok:true,
@@ -46,14 +46,24 @@ module.exports.editConfig = function(instance, entry, newValue){
} else {
config[entry] = newValue;
console.log("Changed config entry "+entry+" from "+config[entry]+" to '"+newValue+"'");
console.log("new config file:");
console.log(JSON.stringify(config, null, " "))
// console.log("new config file:");
// console.log(JSON.stringify(config, null, " "))
fs.writeFileSync("config.json", JSON.stringify(config, null, 4));
return {
ok:true,
msg:`Changed config entry ${entry} from ***** to '${newValue}'`,
};
}
} else {
return {
ok:false,
msg:`No such config parameter`,
}
}
} else {
return {
ok:false,
msg:`Editing config for single instances is not yet supported`,
}
}
};