Merge pull request #14940 from NixOS/backport-14778-to-2.30-maintenance

[Backport 2.30-maintenance] test: add shebangs to shell.nix test scripts
This commit is contained in:
internal-nix-ci[bot]
2026-01-07 14:19:40 +00:00
committed by GitHub

View File

@@ -96,14 +96,16 @@ let
foo = runCommand "foo" { } ''
mkdir -p $out/bin
echo 'echo ${fooContents}' > $out/bin/foo
echo '#!${shell}' > $out/bin/foo
echo 'echo ${fooContents}' >> $out/bin/foo
chmod a+rx $out/bin/foo
ln -s ${shell} $out/bin/bash
'';
bar = runCommand "bar" { } ''
mkdir -p $out/bin
echo 'echo bar' > $out/bin/bar
echo '#!${shell}' > $out/bin/bar
echo 'echo bar' >> $out/bin/bar
chmod a+rx $out/bin/bar
'';
@@ -116,7 +118,8 @@ let
# ruby "interpreter" that outputs "$@"
ruby = runCommand "ruby" { } ''
mkdir -p $out/bin
echo 'printf %s "$*"' > $out/bin/ruby
echo '#!${shell}' > $out/bin/ruby
echo 'printf %s "$*"' >> $out/bin/ruby
chmod a+rx $out/bin/ruby
'';