From 6e156daaf63703df17cd376bd1d2d752272b458f Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Thu, 17 Feb 2022 14:07:51 -0500 Subject: [PATCH] fix: don't load setup.json into nconf if setup.json doesn't exist --- install/web.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/install/web.js b/install/web.js index 8d5774326b..68b4ae5a7b 100644 --- a/install/web.js +++ b/install/web.js @@ -284,12 +284,15 @@ async function copyCSS() { async function loadDefaults() { const setupDefaultsPath = path.join(__dirname, '../setup.json'); try { - await fs.promises.access(setupDefaultsPath, fs.constants.F_OK + fs.constants.R_OK); + // eslint-disable-next-line no-bitwise + await fs.promises.access(setupDefaultsPath, fs.constants.F_OK | fs.constants.R_OK); } catch (err) { // setup.json not found or inaccessible, proceed with no defaults if (err.code !== 'ENOENT') { throw err; } + + return; } winston.info('[installer] Found setup.json, populating default values'); nconf.file({