Refactor environment variable handling in package.json scripts, update .env.example for consistency, and enhance Turbo configuration for environment variable passthrough. Modify API content type parsing and resolve circular dependencies in Auth and Billing modules. Add unique username generation logic in bootstrap-admin script.
This commit is contained in:
25
scripts/run-with-env.mjs
Normal file
25
scripts/run-with-env.mjs
Normal file
@@ -0,0 +1,25 @@
|
||||
import { spawnSync } from 'node:child_process';
|
||||
import { existsSync } from 'node:fs';
|
||||
import { resolve } from 'node:path';
|
||||
|
||||
const root = resolve(import.meta.dirname, '..');
|
||||
const envFile = resolve(root, '.env');
|
||||
|
||||
if (existsSync(envFile)) {
|
||||
process.loadEnvFile(envFile);
|
||||
}
|
||||
|
||||
const [command, ...args] = process.argv.slice(2);
|
||||
|
||||
if (!command) {
|
||||
console.error('Usage: node scripts/run-with-env.mjs <command> [args...]');
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
const result = spawnSync(command, args, {
|
||||
cwd: root,
|
||||
stdio: 'inherit',
|
||||
env: process.env,
|
||||
});
|
||||
|
||||
process.exit(result.status ?? 1);
|
||||
Reference in New Issue
Block a user