Skip to content

Commit

Permalink
fix: recursive expansion
Browse files Browse the repository at this point in the history
  • Loading branch information
motdotla committed Feb 15, 2024
1 parent 7231e81 commit 5dcc08c
Show file tree
Hide file tree
Showing 2 changed files with 537 additions and 519 deletions.
7 changes: 6 additions & 1 deletion lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,12 @@ function interpolate (value, processEnv, parsed) {
}

if (parsed[key]) {
return parsed[key]
// avoid recursion from EXPAND_SELF=$EXPAND_SELF
if (parsed[key] === value) {
return parsed[key]
} else {
return interpolate(parsed[key], processEnv, parsed)
}
}

if (defaultValue) {
Expand Down
Loading

0 comments on commit 5dcc08c

Please sign in to comment.