about summary refs log tree commit diff
path: root/nixpkgs/pkgs/test/stdenv/patch-shebangs.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/test/stdenv/patch-shebangs.nix')
-rw-r--r--nixpkgs/pkgs/test/stdenv/patch-shebangs.nix17
1 files changed, 16 insertions, 1 deletions
diff --git a/nixpkgs/pkgs/test/stdenv/patch-shebangs.nix b/nixpkgs/pkgs/test/stdenv/patch-shebangs.nix
index 888d4a53a273..db9ca2fcaafe 100644
--- a/nixpkgs/pkgs/test/stdenv/patch-shebangs.nix
+++ b/nixpkgs/pkgs/test/stdenv/patch-shebangs.nix
@@ -72,11 +72,26 @@ let
       };
     };
 
+    without-trailing-newline = stdenv.mkDerivation {
+      name = "without-trailing-newline";
+      strictDeps = false;
+      dontUnpack = true;
+      installPhase = ''
+        mkdir -p $out/bin
+        printf "#!/bin/bash" > $out/bin/test
+        chmod +x $out/bin/test
+        dontPatchShebangs=
+      '';
+      passthru = {
+        assertion = "grep '^#!${stdenv.shell}' $out/bin/test > /dev/null";
+      };
+    };
+
   };
 in
 stdenv.mkDerivation {
   name = "test-patch-shebangs";
-  passthru = { inherit (tests) bad-shebang ignores-nix-store updates-nix-store split-string; };
+  passthru = { inherit (tests) bad-shebang ignores-nix-store updates-nix-store split-string without-trailing-newline; };
   buildCommand = ''
     validate() {
       local name=$1