mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-26 12:53:59 +03:00
patch-shebangs: use isScript to safely check for shebang start
Fixes commonly encountered errors about broken pipes or null-bytes in command-substitution.
This commit is contained in:
parent
f66ae2c8b2
commit
830f9fabd4
@ -19,9 +19,8 @@ patchShebangs() {
|
||||
local newInterpreterLine
|
||||
|
||||
find "$dir" -type f -perm -0100 | while read f; do
|
||||
if [ "$(head -1 "$f" | head -c+2)" != '#!' ]; then
|
||||
# missing shebang => not a script
|
||||
continue
|
||||
if ! isScript "$f"; then
|
||||
continue
|
||||
fi
|
||||
|
||||
oldInterpreterLine=$(head -1 "$f" | tail -c+3)
|
||||
|
Loading…
Reference in New Issue
Block a user