1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-08 19:23:54 +02:00

Escape filename given to nix-shell in shebang mode

This prevents spaces or other metacharacters from causing nix-shell to
execute the wrong path.

Fixes #4229.
This commit is contained in:
Lily Ballard 2020-11-24 14:12:32 -08:00
parent 605bacdc92
commit 437189e446
3 changed files with 20 additions and 4 deletions

View file

@ -50,7 +50,7 @@ let pkgs = rec {
# ruby "interpreter" that outputs "$@"
ruby = runCommand "ruby" {} ''
mkdir -p $out/bin
echo 'printf -- "$*"' > $out/bin/ruby
echo 'printf %s "$*"' > $out/bin/ruby
chmod a+rx $out/bin/ruby
'';