Skip to content

Commit

Permalink
refactor: made adding a new loader easier
Browse files Browse the repository at this point in the history
Co-authored-by: KilianKilmister <KilianKilmister@users.noreply.github.com>
  • Loading branch information
k-yle and KilianKilmister committed Dec 11, 2024
1 parent 4790a82 commit 7166412
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/parse-env-file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

/**
Expand Down

0 comments on commit 7166412

Please sign in to comment.