fix: runtime env variables working with new tm_ env variables

This commit is contained in:
Ralph Khreish
2025-10-15 22:47:30 +02:00
parent fb68c9fe1f
commit 5aca107827
4 changed files with 19 additions and 6 deletions

View File

@@ -9,6 +9,8 @@
*/
import dotenv from 'dotenv';
// Load .env BEFORE any other imports to ensure env vars are available
dotenv.config();
// Add at the very beginning of the file
@@ -16,7 +18,8 @@ if (process.env.DEBUG === '1') {
console.error('DEBUG - dev.js received args:', process.argv.slice(2));
}
import { runCLI } from './modules/commands.js';
// Use dynamic import to ensure dotenv.config() runs before module-level code executes
const { runCLI } = await import('./modules/commands.js');
// Run the CLI with the process arguments
runCLI(process.argv);