shims/super/cc: only set HOMEBREW_LD_LIBRARY_PATH when needed

Co-authored-by: Bo Anderson <mail@boanderson.me>
This commit is contained in:
Ruoyu Zhong 2024-08-26 00:39:27 +08:00 committed by GitHub
parent fb57604fe2
commit 0b3b7d9bc3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -5,7 +5,11 @@ then
echo "${0##*/}: The build tool has reset ENV; --env=std required." >&2
exit 1
fi
unset HOMEBREW_LD_LIBRARY_PATH
if [[ -n "${LD_LIBRARY_PATH+set}" ]]
then
export HOMEBREW_LD_LIBRARY_PATH="${LD_LIBRARY_PATH}"
fi
unset LD_LIBRARY_PATH
unset RUBYLIB
exec "${HOMEBREW_RUBY_PATH}" --enable-frozen-string-literal --disable=gems,did_you_mean,rubyopt -x "$0" "$@"