Skip to content

Commit ec46a48

Browse files
committed
support dot env node native
1 parent c6df37e commit ec46a48

3 files changed

Lines changed: 17 additions & 0 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,4 @@ docs/api/
2626

2727
dw.json
2828
dw.json*
29+
.env

packages/b2c-cli/bin/dev.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@
44
* SPDX-License-Identifier: Apache-2
55
* For full license text, see the license.txt file in the repo root or http://www.apache.org/licenses/LICENSE-2.0
66
*/
7+
8+
// Load .env file if present (Node.js native support)
9+
try {
10+
process.loadEnvFile();
11+
} catch {
12+
// .env file not found or not readable, continue without it
13+
}
14+
715
import {execute} from '@oclif/core';
816

917
await execute({development: true, dir: import.meta.url});

packages/b2c-cli/bin/run.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@
44
* SPDX-License-Identifier: Apache-2
55
* For full license text, see the license.txt file in the repo root or http://www.apache.org/licenses/LICENSE-2.0
66
*/
7+
8+
// Load .env file if present (Node.js native support)
9+
try {
10+
process.loadEnvFile();
11+
} catch {
12+
// .env file not found or not readable, continue without it
13+
}
14+
715
import {execute} from '@oclif/core';
816

917
await execute({dir: import.meta.url});

0 commit comments

Comments
 (0)