aboutsummaryrefslogtreecommitdiff
path: root/src/scripts/run-with-database-url.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/scripts/run-with-database-url.ts')
-rw-r--r--src/scripts/run-with-database-url.ts13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/scripts/run-with-database-url.ts b/src/scripts/run-with-database-url.ts
new file mode 100644
index 0000000..b7ae3a7
--- /dev/null
+++ b/src/scripts/run-with-database-url.ts
@@ -0,0 +1,13 @@
+import {DATA_DIR} from '../services/config.js';
+import createDatabaseUrl from '../utils/create-database-url.js';
+import {execa} from 'execa';
+
+process.env.DATABASE_URL = createDatabaseUrl(DATA_DIR);
+
+(async () => {
+ await execa(process.argv[2], process.argv.slice(3), {
+ preferLocal: true,
+ stderr: process.stderr,
+ stdout: process.stdout,
+ });
+})();