Browse Source

check file exists function added

ca333-dev
Satinder Grewal 8 years ago
parent
commit
c193379dba
  1. 13
      routes/shepherd.js

13
routes/shepherd.js

@ -221,6 +221,12 @@ function setConf(flock) {
console.log(DaemonConfPath); console.log(DaemonConfPath);
var CheckFileExists = function() {
fs.ensureFile(DaemonConfPath, function (err) {
console.log(err) // => null
})
}
var RemoveLines = function() { var RemoveLines = function() {
return new Promise(function(resolve, reject) { return new Promise(function(resolve, reject) {
@ -247,7 +253,7 @@ function setConf(flock) {
var result = 'CheckConf is done' var result = 'CheckConf is done'
setconf.status(DaemonConfPath, function(err, status) { setconf.status(DaemonConfPath, function(err, status) {
//console.log(status[0]); console.log(status[0]);
//console.log(status[0].rpcuser); //console.log(status[0].rpcuser);
var rpcuser = function() { var rpcuser = function() {
@ -349,10 +355,11 @@ function setConf(flock) {
}) })
} }
RemoveLines() CheckFileExists()
.then(function(result) { .then(function(result) {
return CheckConf(); return RemoveLines();
}) })
.then(CheckConf)
} }

Loading…
Cancel
Save