Skip to content

Commit

Permalink
Merge pull request #155 from KilianKilmister/master
Browse files Browse the repository at this point in the history
refactor: made adding a new loader easier
  • Loading branch information
k-yle authored Dec 16, 2024
2 parents bcd9f59 + 7166412 commit 8c55ce6
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 8c55ce6

Please sign in to comment.