Skip to content

Commit 41c7506

Browse files
committed
Add --bun option
1 parent 6ea838b commit 41c7506

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

cmd/run.go

+7-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import (
1414

1515
var cmdAsLabel bool
1616
var npmCmds []string
17+
var runWithBun bool
1718
var names []string
1819

1920
var runCommand = cobra.Command{
@@ -35,6 +36,7 @@ func init() {
3536

3637
runCommand.PersistentFlags().BoolVarP(&cmdAsLabel, "command-as-label", "L", false, "use each command as its own label")
3738
runCommand.PersistentFlags().StringArrayVarP(&npmCmds, "npm", "n", []string{}, "npm command")
39+
runCommand.PersistentFlags().BoolVarP(&runWithBun, "bun", "b", false, "Run npm commands with Bun")
3840
runCommand.PersistentFlags().StringArrayVarP(&names, "label", "l", []string{}, "label prefix for the command")
3941
runCommand.PersistentFlags().BoolVarP(&noLabel, "no-label", "B", false, "do not attach label/prefix to output")
4042
rootCmd.AddCommand(&runCommand)
@@ -79,7 +81,11 @@ func collectCommands(args []string) ([]string, []string, error) {
7981

8082
for _, script := range matchingScripts {
8183
commandStrings = append(commandStrings, script)
82-
commands = append(commands, "npm run "+script)
84+
if runWithBun {
85+
commands = append(commands, "bun run "+script)
86+
} else {
87+
commands = append(commands, "npm run "+script)
88+
}
8389
}
8490

8591
continue

0 commit comments

Comments
 (0)