mirror of
https://github.com/toddbluhm/env-cmd.git
synced 2025-12-08 18:23:33 +00:00
refactor: made adding a new loader easier
Co-authored-by: KilianKilmister <KilianKilmister@users.noreply.github.com>
This commit is contained in:
parent
4790a8251b
commit
7166412acf
@ -34,12 +34,18 @@ export async function getEnvFileVars(envFilePath: string): Promise<Environment>
|
||||
if (isPromise(env)) {
|
||||
env = await env
|
||||
}
|
||||
|
||||
return env;
|
||||
}
|
||||
else {
|
||||
const file = readFileSync(absolutePath, { encoding: 'utf8' })
|
||||
env = parseEnvString(file)
|
||||
|
||||
const file = readFileSync(absolutePath, { encoding: 'utf8' })
|
||||
|
||||
switch (ext) {
|
||||
// other loaders can be added here
|
||||
|
||||
default:
|
||||
return parseEnvString(file)
|
||||
}
|
||||
return env
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user