Skip to content

Commit

Permalink
Allowing data dir to be overridden (#480)
Browse files Browse the repository at this point in the history
* allowing data dir to be overridden

* release notes

* Update load-config.js
  • Loading branch information
MikesGlitch authored Oct 15, 2024
1 parent a8c4c5f commit c309816
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/load-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -135,7 +140,6 @@ const finalConfig = {
}
: config.upload,
};

debug(`using port ${finalConfig.port}`);
debug(`using hostname ${finalConfig.hostname}`);
debug(`using data directory ${finalConfig.dataDir}`);
Expand Down
6 changes: 6 additions & 0 deletions upcoming-release-notes/480.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
category: Enhancements
authors: [MikesGlitch]
---

Allow data directory to be overridden by env variable

0 comments on commit c309816

Please sign in to comment.