Skip to content

Commit 510094a

Browse files
authored
fix a bug in resolveVariables util function (#1488)
1 parent ecd1b06 commit 510094a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Extension/src/common.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,14 +127,14 @@ export function resolveVariables(input: string): string {
127127
let regexp: RegExp = /\$\{(env:|env.)?(.*?)\}/g;
128128
let ret: string = input.replace(regexp, (match: string, ignored: string, name: string) => {
129129
let newValue: string = process.env[name];
130-
return (newValue !== null) ? newValue : match;
130+
return (newValue) ? newValue : match;
131131
});
132132

133133
// Resolve '~' at the start of the path.
134134
regexp = /^\~/g;
135135
ret = ret.replace(regexp, (match: string, name: string) => {
136136
let newValue: string = process.env.HOME;
137-
return (newValue !== null) ? newValue : match;
137+
return (newValue) ? newValue : match;
138138
});
139139

140140
return ret;

0 commit comments

Comments
 (0)