mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
fix: don't load setup.json into nconf if setup.json doesn't exist
This commit is contained in:
@@ -284,12 +284,15 @@ async function copyCSS() {
|
|||||||
async function loadDefaults() {
|
async function loadDefaults() {
|
||||||
const setupDefaultsPath = path.join(__dirname, '../setup.json');
|
const setupDefaultsPath = path.join(__dirname, '../setup.json');
|
||||||
try {
|
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) {
|
} catch (err) {
|
||||||
// setup.json not found or inaccessible, proceed with no defaults
|
// setup.json not found or inaccessible, proceed with no defaults
|
||||||
if (err.code !== 'ENOENT') {
|
if (err.code !== 'ENOENT') {
|
||||||
throw err;
|
throw err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
winston.info('[installer] Found setup.json, populating default values');
|
winston.info('[installer] Found setup.json, populating default values');
|
||||||
nconf.file({
|
nconf.file({
|
||||||
|
|||||||
Reference in New Issue
Block a user