Skip to content

Commit 7166412

Browse files
refactor: made adding a new loader easier
Co-authored-by: KilianKilmister <KilianKilmister@users.noreply.github.com>
1 parent 4790a82 commit 7166412

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/parse-env-file.ts

+10-4
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,18 @@ export async function getEnvFileVars(envFilePath: string): Promise<Environment>
3434
if (isPromise(env)) {
3535
env = await env
3636
}
37+
38+
return env;
3739
}
38-
else {
39-
const file = readFileSync(absolutePath, { encoding: 'utf8' })
40-
env = parseEnvString(file)
40+
41+
const file = readFileSync(absolutePath, { encoding: 'utf8' })
42+
43+
switch (ext) {
44+
// other loaders can be added here
45+
46+
default:
47+
return parseEnvString(file)
4148
}
42-
return env
4349
}
4450

4551
/**

0 commit comments

Comments
 (0)