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:
binarycat 2024-03-11 10:55:46 -04:00
parent 396306d5ce
commit b309d4fdcc

View file

@ -22,6 +22,11 @@ addToLuaSearchPathWithCustomDelimiter() {
# export only if we haven't already got this dir in the search path # export only if we haven't already got this dir in the search path
if [[ ${!varName-} == *"$absPattern"* ]]; then return; fi 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}" export "${varName}=${!varName:+${!varName};}${absPattern}"
} }