From 91aa511fe7107938b0409a02ab8c457a6de2d8ca Mon Sep 17 00:00:00 2001 From: Lily Foster Date: Tue, 7 Mar 2023 10:17:30 -0500 Subject: [PATCH] Convert CRLF for script bin files 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. --- nix/node-env.nix | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/nix/node-env.nix b/nix/node-env.nix index 5dad9ec..bc1e366 100644 --- a/nix/node-env.nix +++ b/nix/node-env.nix @@ -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