You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed that just doesn't split arguments properly in tasks with a shebang. Given the following Justfile:
run:#!/usr/bin/env bash -x ls -lecho"hello"
I'd expect that just run will print and execute the commands.
However, what I get is the following error:
↳ just run
/usr/bin/env: ‘bash -x’: No such file or directory
/usr/bin/env: use -[v]S to pass options in shebang lines
error: Recipe `run` failed with exit code 127
Apparently, only the first space is used to split the command from its arguments. Additional spaces aren't recognized.
The text was updated successfully, but these errors were encountered:
Which OS are you using? Shebang argument splitting on unix is handled by the OS, so the specific behavior is OS-specific. You might need to add the -S flag, like so:
run:
#!/usr/bin/env -S bash -x
ls -l
echo "hello"
This should probably be documented in the readme.
casey
changed the title
Shebang argument splitting
Document using -S to split arguments to /usr/bin/env
May 12, 2024
just 1.25.2
I noticed that just doesn't split arguments properly in tasks with a shebang. Given the following Justfile:
I'd expect that
just run
will print and execute the commands.However, what I get is the following error:
Apparently, only the first space is used to split the command from its arguments. Additional spaces aren't recognized.
The text was updated successfully, but these errors were encountered: