-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: allow expanding env vars in reverse order (#19352)
- Loading branch information
1 parent
2b2299c
commit 3f5f2bd
Showing
7 changed files
with
70 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
VITE_SOURCE=source | ||
VITE_APP_BASE_ROUTE=$VITE_SOURCE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
diff --git a/lib/main.js b/lib/main.js | ||
index 794f3bf512ee8cd24fe20e83d159bf8682fb901e..5567e6e282d65b87deea02f8cb396d3e7276581e 100644 | ||
--- a/lib/main.js | ||
+++ b/lib/main.js | ||
@@ -64,7 +64,7 @@ function expandValue (value, processEnv, runningParsed) { | ||
|
||
function expand (options) { | ||
// for use with progressive expansion | ||
- const runningParsed = {} | ||
+ // const runningParsed = {} | ||
|
||
let processEnv = process.env | ||
if (options && options.processEnv != null) { | ||
@@ -79,13 +79,15 @@ function expand (options) { | ||
if (processEnv[key] && processEnv[key] !== value) { | ||
value = processEnv[key] | ||
} else { | ||
- value = expandValue(value, processEnv, runningParsed) | ||
+ // PATCH: we pass options.parsed instead of runningParsed | ||
+ // to allow variables declared in other files to be used | ||
+ value = expandValue(value, processEnv, options.parsed) | ||
} | ||
|
||
options.parsed[key] = _resolveEscapeSequences(value) | ||
|
||
// for use with progressive expansion | ||
- runningParsed[key] = _resolveEscapeSequences(value) | ||
+ // runningParsed[key] = _resolveEscapeSequences(value) | ||
} | ||
|
||
for (const processKey in options.parsed) { |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.