diff --git a/src/load-config.js b/src/load-config.js index d99ce4211..19696d59d 100644 --- a/src/load-config.js +++ b/src/load-config.js @@ -11,6 +11,11 @@ debug(`project root: '${projectRoot}'`); export const sqlDir = path.join(projectRoot, 'src', 'sql'); let defaultDataDir = fs.existsSync('/data') ? '/data' : projectRoot; + +if (process.env.ACTUAL_DATA_DIR) { + defaultDataDir = process.env.ACTUAL_DATA_DIR; +} + debug(`default data directory: '${defaultDataDir}'`); function parseJSON(path, allowMissing = false) { @@ -135,7 +140,6 @@ const finalConfig = { } : config.upload, }; - debug(`using port ${finalConfig.port}`); debug(`using hostname ${finalConfig.hostname}`); debug(`using data directory ${finalConfig.dataDir}`); diff --git a/upcoming-release-notes/480.md b/upcoming-release-notes/480.md new file mode 100644 index 000000000..bdc690232 --- /dev/null +++ b/upcoming-release-notes/480.md @@ -0,0 +1,6 @@ +--- +category: Enhancements +authors: [MikesGlitch] +--- + +Allow data directory to be overridden by env variable