mirror of
https://github.com/toddbluhm/env-cmd.git
synced 2025-12-08 18:23:33 +00:00
chore: fix CI failing on the master branch
This commit is contained in:
parent
35bee4087a
commit
adf1934f01
2
dist/expand-envs.js
vendored
2
dist/expand-envs.js
vendored
@ -6,6 +6,6 @@ export function expandEnvs(str, envs) {
|
||||
return str.replace(/(?<!\\)\$[a-zA-Z0-9_]+/g, (varName) => {
|
||||
const varValue = envs[varName.slice(1)];
|
||||
// const test = 42;
|
||||
return varValue === undefined ? varName : varValue.toString();
|
||||
return varValue ?? varName;
|
||||
});
|
||||
}
|
||||
|
||||
2
dist/parse-env-file.js
vendored
2
dist/parse-env-file.js
vendored
@ -49,7 +49,7 @@ export async function getEnvFileVars(envFilePath) {
|
||||
*/
|
||||
export function parseEnvString(envFileString) {
|
||||
// First thing we do is stripe out all comments
|
||||
envFileString = stripComments(envFileString.toString());
|
||||
envFileString = stripComments(envFileString);
|
||||
// Next we stripe out all the empty lines
|
||||
envFileString = stripEmptyLines(envFileString);
|
||||
// Merge the file env vars with the current process env vars (the file vars overwrite process vars)
|
||||
|
||||
@ -8,6 +8,6 @@ export function expandEnvs(str: string, envs: Environment): string {
|
||||
return str.replace(/(?<!\\)\$[a-zA-Z0-9_]+/g, (varName) => {
|
||||
const varValue = envs[varName.slice(1)]
|
||||
// const test = 42;
|
||||
return varValue === undefined ? varName : varValue.toString()
|
||||
return varValue ?? varName
|
||||
})
|
||||
}
|
||||
|
||||
@ -56,7 +56,7 @@ export async function getEnvFileVars(envFilePath: string): Promise<Environment>
|
||||
*/
|
||||
export function parseEnvString(envFileString: string): Environment {
|
||||
// First thing we do is stripe out all comments
|
||||
envFileString = stripComments(envFileString.toString())
|
||||
envFileString = stripComments(envFileString)
|
||||
|
||||
// Next we stripe out all the empty lines
|
||||
envFileString = stripEmptyLines(envFileString)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user