mirror of
https://github.com/NixOS/nix
synced 2025-07-08 02:43:54 +02:00
Add opt-out: nix-shell-shebang-arguments-relative-to-script
This commit is contained in:
parent
4c59d6e9f5
commit
63262e78c7
5 changed files with 22 additions and 3 deletions
|
@ -76,6 +76,14 @@ echo "cwd: $PWD"
|
|||
output=$($TEST_ROOT/shell.shebang.expr bar)
|
||||
[ "$output" = foo ]
|
||||
|
||||
# Test nix-shell shebang mode with an alternate working directory
|
||||
sed -e "s|@ENV_PROG@|$(type -P env)|" shell.shebang.legacy.expr > $TEST_ROOT/shell.shebang.legacy.expr
|
||||
chmod a+rx $TEST_ROOT/shell.shebang.legacy.expr
|
||||
# Should fail due to expressions using relative path
|
||||
mkdir -p "$TEST_ROOT/somewhere-unrelated"
|
||||
output="$(cd "$TEST_ROOT/somewhere-unrelated"; $TEST_ROOT/shell.shebang.legacy.expr bar;)"
|
||||
[[ $(realpath "$output") = $(realpath "$TEST_ROOT/somewhere-unrelated") ]]
|
||||
|
||||
# Test nix-shell shebang mode again with metacharacters in the filename.
|
||||
# First word of filename is chosen to not match any file in the test root.
|
||||
sed -e "s|@ENV_PROG@|$(type -P env)|" shell.shebang.sh > $TEST_ROOT/spaced\ \\\'\"shell.shebang.sh
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue