-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request NixOS#8470 from ncfavier/shebang-single-quotes
nix-shell: support single quotes in shebangs, fix whitespace parsing (cherry picked from commit 3b99c62) Change-Id: I2a431b21c3467eefa1ef95d5a36d672f45b6937a
- Loading branch information
eldritch horrors
committed
Mar 4, 2024
1 parent
7f590ea
commit 032eff7
Showing
5 changed files
with
46 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
# Release X.Y (202?-??-??) | ||
|
||
- `nix-shell` shebang lines now support single-quoted arguments. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#! @ENV_PROG@ nix-shell | ||
#! nix-shell -I nixpkgs=shell.nix --no-substitute | ||
#! nix-shell --argstr s1 'foo "bar" \baz'"'"'qux' --argstr s2 "foo 'bar' \"\baz" --argstr s3 \foo\ bar\'baz --argstr s4 '' | ||
#! nix-shell shell.shebang.nix --command true | ||
{ s1, s2, s3, s4 }: | ||
assert s1 == ''foo "bar" \baz'qux''; | ||
assert s2 == "foo 'bar' \"baz"; | ||
assert s3 == "foo bar'baz"; | ||
assert s4 == ""; | ||
(import <nixpkgs> {}).runCommand "nix-shell" {} "" |