📡 Make user-data directory configurable

This commit is contained in:
Alicia Sykes
2024-04-10 22:59:35 +01:00
parent a32e76935e
commit b66ce53669
3 changed files with 4 additions and 4 deletions

View File

@@ -101,7 +101,7 @@ const printFileReadError = (e) => {
let config = {};
try { // Try to open and parse the YAML file
config = yaml.load(fs.readFileSync('./user-data/conf.yml', 'utf8'));
config = yaml.load(fs.readFileSync(`./${process.env.USER_DATA_DIR || 'user-data'}/conf.yml`, 'utf8'));
validate(config);
} catch (e) { // Something went very wrong...
setIsValidVariable(false);

View File

@@ -18,7 +18,7 @@ module.exports = async (newConfig, render) => {
// Define constants for the config file
const settings = {
defaultLocation: './user-data/',
defaultLocation: process.env.USER_DATA_DIR || './user-data/',
defaultFile: 'conf.yml',
filename: 'conf',
backupDenominator: '.backup.yml',