Skip to content

Commit e65e1c9

Browse files
authored
use process.cwd() (#201)
fixes #198
1 parent 89f9f00 commit e65e1c9

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

.changeset/pink-hotels-fry.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"varlock": patch
3+
---
4+
5+
use process.cwd() instead of process.env.PWD

packages/varlock/src/env-graph/lib/loader.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,6 @@ import _ from '@env-spec/utils/my-dash';
22
import { EnvGraph } from './env-graph';
33
import { DirectoryDataSource } from './data-source';
44

5-
function autoDetectBasePath() {
6-
const PWD = process.env.PWD;
7-
if (!PWD) {
8-
throw new Error('PWD is not set');
9-
}
10-
return PWD;
11-
}
12-
13-
145
export async function loadEnvGraph(opts?: {
156
basePath?: string,
167
relativePaths?: Array<string>,
@@ -20,7 +11,7 @@ export async function loadEnvGraph(opts?: {
2011
afterInit?: (graph: EnvGraph) => Promise<void>,
2112
}) {
2213
const graph = new EnvGraph();
23-
graph.basePath = opts?.basePath ?? autoDetectBasePath();
14+
graph.basePath = opts?.basePath ?? process.cwd();
2415

2516
if (opts?.afterInit) {
2617
await opts.afterInit(graph);

0 commit comments

Comments
 (0)