lua: actually fix longstanding bug in lua envHook causing relative module imports to stop working
somehow, between all my testing, all the code review, and my code being copy-pasted into other people's PRs, noone noticed the glaring issue in the singular line of code i committed. there was a missing negation. this has now been fixed.
This commit is contained in:
parent
396306d5ce
commit
b309d4fdcc
1 changed files with 5 additions and 0 deletions
|
@ -22,6 +22,11 @@ addToLuaSearchPathWithCustomDelimiter() {
|
|||
# export only if we haven't already got this dir in the search path
|
||||
if [[ ${!varName-} == *"$absPattern"* ]]; then return; fi
|
||||
|
||||
# if the path variable has not yet been set, initialize it to ";;"
|
||||
# this is a magic value that will be replaced by the default,
|
||||
# allowing relative modules to be used even when there are system modules.
|
||||
if [[ ! -v "${varName}" ]]; then export "${varName}=;;"; fi
|
||||
|
||||
export "${varName}=${!varName:+${!varName};}${absPattern}"
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue