We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents fe83ddf + 471601a commit 021bdd3Copy full SHA for 021bdd3
src/utils/core.ts
@@ -140,8 +140,16 @@ function loadEnvironment(folder: string, env: { [key: string]: string }) {
140
const [key, value] = trimmed.split("=");
141
if (key && value !== undefined) {
142
env[key.trim()] = value
143
+ // Normalize
144
.replace(/["']/gs, "")
- .replace(/(?:\$HOME|~)/gs, homedir())
145
+ // Variable expansion
146
+ .replace(
147
+ /\$([A-Za-z_]+[A-Za-z0-9_]*)|\${([A-Za-z0-9_]*)}|%([A-Za-z_]+[A-Za-z0-9_]*)%/g,
148
+ (match, a, b, c) => {
149
+ const v = a ?? b ?? c;
150
+ return env[v] ?? process.env[v] ?? match;
151
+ },
152
+ )
153
.trim();
154
}
155
0 commit comments