Fix config file not being loaded from the project root by default (#249)

This commit is contained in:
Constantin Mihai
2023-08-16 22:03:58 +03:00
committed by GitHub
parent 87747a83b9
commit ad65fcdffc
2 changed files with 14 additions and 2 deletions

View File

@@ -34,8 +34,14 @@ if (process.env.ACTUAL_CONFIG_PATH) {
);
userConfig = parseJSON(process.env.ACTUAL_CONFIG_PATH);
} else {
debug(`loading config from default path: '${defaultDataDir}/config.json'`);
userConfig = parseJSON(path.join(defaultDataDir, 'config.json'), true);
let configFile = path.join(projectRoot, 'config.json');
if (!fs.existsSync(configFile)) {
configFile = path.join(defaultDataDir, 'config.json');
}
debug(`loading config from default path: '${configFile}'`);
userConfig = parseJSON(configFile, true);
}
/** @type {Omit<import('./config-types.js').Config, 'mode' | 'serverFiles' | 'userFiles'>} */

View File

@@ -0,0 +1,6 @@
---
category: Bugfix
authors: [UnexomWid]
---
Fix config file not being loaded from the project root by default