Skip to content

Commit

Permalink
Convert CRLF for script bin files
Browse files Browse the repository at this point in the history
After we started generating our own bin links, we did not provide the
line-ending normalization that npm did. This corrects that to have
similar behavior to before for packages with CRLF line-endings.

This also has a drive-by change to remove the unnecessary
`patchShebangs` due to the `patchShebangsAuto` hook running and finding
these files just fine now.
  • Loading branch information
lilyinstarlight committed Mar 7, 2023
1 parent 315e1b8 commit 91aa511
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions nix/node-env.nix
Original file line number Diff line number Diff line change
Expand Up @@ -530,12 +530,15 @@ let
then
ln -s $out/lib/node_modules/.bin $out/bin
# Patch the shebang lines of all the executables
# Fixup all executables
ls $out/bin/* | while read i
do
file="$(readlink -f "$i")"
chmod u+rwx "$file"
patchShebangs "$file"
if isScript "$file"
then
sed -i 's/\r$//' "$file" # convert crlf to lf
fi
done
fi
Expand Down

0 comments on commit 91aa511

Please sign in to comment.