From 1206c973f94e6aa5c43931856a42b1ad5baa8e46 Mon Sep 17 00:00:00 2001 From: kern3l-pan1c Date: Thu, 19 Oct 2023 19:20:43 +0530 Subject: [PATCH] Updated fs.exists (deprecated) to fs.existsSync --- lib/daemon.js | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/lib/daemon.js b/lib/daemon.js index e4f90b8..0530785 100644 --- a/lib/daemon.js +++ b/lib/daemon.js @@ -537,18 +537,16 @@ var daemon = function (config) { dir = this.directory(dir); // If the output directory does not exist, create it. - fs.exists(dir, function (exists) { - if (!exists) { - fs.mkdirSync(dir); - } - // Write the configuration file - fs.writeFile(path.resolve(dir, me.id + '.xml'), me._xml, function () { - // Write the exe file - winsw.createExe(me.id, dir, function () { - me.execute('"' + path.resolve(dir, me._exe) + '" install', function () { - sleep(2); - me.emit('install'); - }); + if (!fs.existsSync(dir)) { + fs.mkdirSync(dir); + } + // Write the configuration file + fs.writeFile(path.resolve(dir, me.id + '.xml'), me._xml, function () { + // Write the exe file + winsw.createExe(me.id, dir, function () { + me.execute('"' + path.resolve(dir, me._exe) + '" install', function () { + sleep(2); + me.emit('install'); }); }); });