All checks were successful
Check Flake / check-flake (push) Successful in 2m46s
49 lines
1.8 KiB
Diff
49 lines
1.8 KiB
Diff
diff --git a/src/load-config.js b/src/load-config.js
|
|
index d99ce42..42d1351 100644
|
|
--- a/src/load-config.js
|
|
+++ b/src/load-config.js
|
|
@@ -3,7 +3,8 @@ import path from 'node:path';
|
|
import { fileURLToPath } from 'node:url';
|
|
import createDebug from 'debug';
|
|
|
|
-const debug = createDebug('actual:config');
|
|
+// const debug = createDebug('actual:config');
|
|
+const debug = console.log;
|
|
const debugSensitive = createDebug('actual-sensitive:config');
|
|
|
|
const projectRoot = path.dirname(path.dirname(fileURLToPath(import.meta.url)));
|
|
@@ -108,6 +109,7 @@ const finalConfig = {
|
|
serverFiles: process.env.ACTUAL_SERVER_FILES || config.serverFiles,
|
|
userFiles: process.env.ACTUAL_USER_FILES || config.userFiles,
|
|
webRoot: process.env.ACTUAL_WEB_ROOT || config.webRoot,
|
|
+ dataDir: process.env.ACTUAL_DATA_DIR || config.dataDir,
|
|
https:
|
|
process.env.ACTUAL_HTTPS_KEY && process.env.ACTUAL_HTTPS_CERT
|
|
? {
|
|
diff --git a/src/migrations.js b/src/migrations.js
|
|
index cba7db0..9983471 100644
|
|
--- a/src/migrations.js
|
|
+++ b/src/migrations.js
|
|
@@ -1,6 +1,12 @@
|
|
import migrate from 'migrate';
|
|
import path from 'node:path';
|
|
import config from './load-config.js';
|
|
+import { fileURLToPath } from 'url';
|
|
+
|
|
+const __filename = fileURLToPath(import.meta.url);
|
|
+const __dirname = path.dirname(__filename);
|
|
+const appRoot = path.dirname(__dirname);
|
|
+const migrationsDirectory = path.join(appRoot, "migrations");
|
|
|
|
export default function run(direction = 'up') {
|
|
console.log(
|
|
@@ -13,7 +19,7 @@ export default function run(direction = 'up') {
|
|
stateStore: `${path.join(config.dataDir, '.migrate')}${
|
|
config.mode === 'test' ? '-test' : ''
|
|
}`,
|
|
- migrationsDirectory: `${path.join(config.projectRoot, 'migrations')}`,
|
|
+ migrationsDirectory
|
|
},
|
|
(err, set) => {
|
|
if (err) {
|