This commit is contained in:
Benjamin Toby
2025-04-17 11:27:45 +01:00
parent a9c0dd4b63
commit d41d28104f
3 changed files with 7 additions and 3 deletions
+3 -1
View File
@@ -5,7 +5,9 @@ export default function parseEnv(/** Env File Path */ envPath: string) {
let obj: { [k: string]: string } = {};
const finalEnvPath = path.resolve(process.cwd(), envPath);
const envFile = fs.readFileSync(finalEnvPath, "utf-8");
const envLinesArr = envFile.split(/\r\n/).filter((ln) => ln.match(/\=/));
const envLinesArr = envFile
.split(/\r\n|\n|\r/)
.filter((ln) => ln.match(/\=/));
envLinesArr.forEach((ln) => {
const keyValArr = ln.split("=");