Remove jsonfile dependency from config editor
parent
3807f371e2
commit
c593adc570
|
@ -4,8 +4,7 @@ process.on('uncaughtException', function (err) {
|
|||
});
|
||||
var configLocation = __dirname+'/../conf.json';
|
||||
var fs = require('fs');
|
||||
var jsonfile = require("jsonfile");
|
||||
var config = jsonfile.readFileSync(configLocation);
|
||||
var config = JSON.parse(fs.readFileSync(configLocation));
|
||||
var processArgv = process.argv.splice(2,process.argv.length)
|
||||
var arguments = {};
|
||||
|
||||
|
@ -57,7 +56,25 @@ processArgv.forEach(function(val) {
|
|||
console.log(index + ': ' + value);
|
||||
});
|
||||
|
||||
jsonfile.writeFile(configLocation,config,{spaces: 2},function(){
|
||||
try{
|
||||
const dockerConfigFile = '/config/conf.json'
|
||||
fs.stat(dockerConfigFile,(err) => {
|
||||
if(!err){
|
||||
fs.stat('../thisIsDocker.txt',(err) => {
|
||||
if(!err){
|
||||
fs.writeFile(dockerConfigFile,JSON.stringify(config,null,3),function(){
|
||||
console.log('Changes Complete. Here is what it is now.')
|
||||
console.log(JSON.stringify(config,null,2))
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}catch(err){
|
||||
console.log(err)
|
||||
}
|
||||
|
||||
fs.writeFile(configLocation,JSON.stringify(config,null,3),function(){
|
||||
console.log('Changes Complete. Here is what it is now.')
|
||||
console.log(JSON.stringify(config,null,2))
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue