@realtimex/email-automator 2.3.0 → 2.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/api/src/config/index.ts
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import dotenv from 'dotenv';
|
|
2
2
|
import { fileURLToPath } from 'url';
|
|
3
|
-
import { dirname, join } from 'path';
|
|
4
|
-
|
|
5
|
-
// 1. Try to load from current working directory (e.g. where npx is run)
|
|
6
|
-
dotenv.config({ path: join(process.cwd(), '.env') });
|
|
7
|
-
// 2. Fallback to package root
|
|
8
|
-
dotenv.config();
|
|
3
|
+
import path, { dirname, join } from 'path';
|
|
9
4
|
|
|
10
5
|
const __filename = fileURLToPath(import.meta.url);
|
|
11
6
|
const __dirname = dirname(__filename);
|
|
12
7
|
|
|
8
|
+
// 1. Try to load from current working directory (where npx is run)
|
|
9
|
+
dotenv.config({ path: join(process.cwd(), '.env') });
|
|
10
|
+
|
|
11
|
+
// 2. Fallback to package root (where the binary lives)
|
|
12
|
+
// In dist/api/src/config/index.js, the root is 4 levels up
|
|
13
|
+
dotenv.config({ path: join(__dirname, '..', '..', '..', '.env') });
|
|
14
|
+
|
|
13
15
|
function parseArgs(args: string[]): { port: number | null, noUi: boolean } {
|
|
14
16
|
const portIndex = args.indexOf('--port');
|
|
15
17
|
let port = null;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import dotenv from 'dotenv';
|
|
2
2
|
import { fileURLToPath } from 'url';
|
|
3
3
|
import { dirname, join } from 'path';
|
|
4
|
-
// 1. Try to load from current working directory (e.g. where npx is run)
|
|
5
|
-
dotenv.config({ path: join(process.cwd(), '.env') });
|
|
6
|
-
// 2. Fallback to package root
|
|
7
|
-
dotenv.config();
|
|
8
4
|
const __filename = fileURLToPath(import.meta.url);
|
|
9
5
|
const __dirname = dirname(__filename);
|
|
6
|
+
// 1. Try to load from current working directory (where npx is run)
|
|
7
|
+
dotenv.config({ path: join(process.cwd(), '.env') });
|
|
8
|
+
// 2. Fallback to package root (where the binary lives)
|
|
9
|
+
// In dist/api/src/config/index.js, the root is 4 levels up
|
|
10
|
+
dotenv.config({ path: join(__dirname, '..', '..', '..', '.env') });
|
|
10
11
|
function parseArgs(args) {
|
|
11
12
|
const portIndex = args.indexOf('--port');
|
|
12
13
|
let port = null;
|