Browse Source

Add listFile directory if doens't exist

pull/3/head
Muthu Kumar 7 years ago
parent
commit
7df9ccf425
  1. 3
      utils/listFile.js

3
utils/listFile.js

@ -27,8 +27,6 @@ function appendToList(domain, outPort, inPort) {
"inPort": inPort "inPort": inPort
} }
} }
jsonFile = {}
if (fs.existsSync(listFilePath)) { if (fs.existsSync(listFilePath)) {
jsonFile = fs.readFileSync(listFilePath); jsonFile = fs.readFileSync(listFilePath);
@ -45,7 +43,6 @@ function appendToList(domain, outPort, inPort) {
jsonFile = beautifyJSON(jsonFile, null, 2, 30); jsonFile = beautifyJSON(jsonFile, null, 2, 30);
} }
else { else {
jsonFile = {}
jsonFile[domain] = domBlock; jsonFile[domain] = domBlock;
jsonFile = beautifyJSON(jsonFile); jsonFile = beautifyJSON(jsonFile);
} }

Loading…
Cancel
Save