chore: fix CI failing on the master branch

This commit is contained in:
Kyle Hensel 2025-08-05 20:00:00 +12:00
parent 35bee4087a
commit adf1934f01
No known key found for this signature in database
GPG Key ID: A6481E3E38D544EC
4 changed files with 6 additions and 6 deletions

2
dist/expand-envs.js vendored
View File

@ -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;
});
}

View File

@ -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)
@ -110,7 +110,7 @@ export function normalizeEnvObject(input, absolutePath) {
const env = {};
for (const [key, value] of Object.entries(input)) {
// we're intentionally stringifying the value here, to
// match what `child_process.spawn` does when loading
// match what `child_process.spawn` does when loading
// env variables.
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
env[key] = `${value}`;

View File

@ -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
})
}

View File

@ -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)
@ -126,7 +126,7 @@ export function normalizeEnvObject(input: unknown, absolutePath: string): Enviro
const env: Environment = {};
for (const [key, value] of Object.entries(input)) {
// we're intentionally stringifying the value here, to
// match what `child_process.spawn` does when loading
// match what `child_process.spawn` does when loading
// env variables.
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
env[key] = `${value}`