bun
bun copied to clipboard
Add `--cmd` to execute specific commands for Bun shell
What is the problem this feature would solve?
Most tools/Libraries use -c
to specify command to be executed in the shell, such as bash -c "echo 'bash is executed'"
.
Examples as following:
set shell := ["python3", "-c"]
set shell := ["bash", "-uc"]
set shell := ["zsh", "-uc"]
set shell := ["fish", "-c"]
set shell := ["nu", "-c"]
Could Bun supply --cmd
option to execute command?
What is the feature you are proposing to solve the problem?
Execute shell command by --cmd
from command line, and now -c
is used for config load.
What alternatives have you considered?
No response
it is not documented yet but bun exec
serves this purpose.
As per the child_process.exec
and child_process.execSync
's shell
option documentation:
shell:
Shell to execute the command with. See Shell requirements and Default Windows shell. Default: '/bin/sh' on Unix, process.env.ComSpec on Windows.
Shell requirements # The shell should understand the -c switch. If the shell is 'cmd.exe', it should understand the /d /s /c switches and command-line parsing should be compatible.
it would be useful if the bun binary were to support this convention for the bun shell.