Open mangs opened 8 months ago
I discovered that the bun exec
command does this already, but there may be confusion between bun run
and bun exec
for some people due to the similarities in colloquial use of terms exec
and run
; they're often used interchangeably. This suggestion would make the intent more clear in my opinion.
This took entirely too long to figure out. Well, once I came across this post only a few minutes. Here's an example that works:
package.json
{
"scripts": {
"clean": "bun exec 'rm -rf ./dist'"
}
}
then in your terminal
bun run clean
What is the problem this feature would solve?
Having access to the Bun shell would be really nice to have when writing out
package.json
scripts, especially when considering its cross-platform benefits.What is the feature you are proposing to solve the problem?
bun shell <command>
Extracting values, response codes, etc from template strings can potentially be ignored in this use case. Looking over the Bun shell examples, there are quite a few that are simple strings that would fit this use case.
Some examples from the documentation that would work:
Some other examples that may be useful
What alternatives have you considered?
Populating a
scripts/
directory with Bun shell code, but that requires more setup than a simple inline script