patch-shebangs: fix env -S with only one argument (#378221)

This commit is contained in:
K900
2025-02-09 09:31:01 +03:00
committed by GitHub
@@ -89,7 +89,7 @@ patchShebangs() {
if [[ "$oldPath" == *"/bin/env" ]]; then
if [[ $arg0 == "-S" ]]; then
arg0=${args%% *}
args=${args#* }
[[ "$args" == *" "* ]] && args=${args#* } || args=
newPath="$(PATH="${!pathName}" type -P "env" || true)"
args="-S $(PATH="${!pathName}" type -P "$arg0" || true) $args"