Merge pull request #155 from KilianKilmister/master

refactor: made adding a new loader easier
This commit is contained in:
Kyℓe Hensel 2024-12-17 11:20:44 +13:00 committed by GitHub
commit 8c55ce619d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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