refactor: made adding a new loader easier

Co-authored-by: KilianKilmister <KilianKilmister@users.noreply.github.com>
This commit is contained in:
Kyle Hensel 2024-12-11 19:30:45 +11:00
parent 4790a8251b
commit 7166412acf
No known key found for this signature in database
GPG Key ID: A6481E3E38D544EC

View File

@ -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
}
/**