diff --git a/pkgs/build-support/setup-hooks/patch-shebangs.sh b/pkgs/build-support/setup-hooks/patch-shebangs.sh index 3a879db2c0ac..3e900d0704cf 100644 --- a/pkgs/build-support/setup-hooks/patch-shebangs.sh +++ b/pkgs/build-support/setup-hooks/patch-shebangs.sh @@ -32,7 +32,7 @@ patchShebangs() { shift fi - header "patching script interpreter paths in $@" + echo "patching script interpreter paths in $@" local f local oldPath local newPath @@ -41,6 +41,11 @@ patchShebangs() { local oldInterpreterLine local newInterpreterLine + if [ $# -eq 0 ]; then + echo "No arguments supplied to patchShebangs" >0 + return 0 + fi + local f while IFS= read -r -d $'\0' f; do isScript "$f" || continue @@ -61,7 +66,7 @@ patchShebangs() { # - options: something starting with a '-' # - environment variables: foo=bar if $(echo "$arg0" | grep -q -- "^-.*\|.*=.*"); then - echo "$f: unsupported interpreter directive \"$oldInterpreterLine\" (set dontPatchShebangs=1 and handle shebang patching yourself)" + echo "$f: unsupported interpreter directive \"$oldInterpreterLine\" (set dontPatchShebangs=1 and handle shebang patching yourself)" >0 exit 1 fi