@@ -14,6 +14,7 @@ import (
14
14
15
15
var cmdAsLabel bool
16
16
var npmCmds []string
17
+ var runWithBun bool
17
18
var names []string
18
19
19
20
var runCommand = cobra.Command {
@@ -35,6 +36,7 @@ func init() {
35
36
36
37
runCommand .PersistentFlags ().BoolVarP (& cmdAsLabel , "command-as-label" , "L" , false , "use each command as its own label" )
37
38
runCommand .PersistentFlags ().StringArrayVarP (& npmCmds , "npm" , "n" , []string {}, "npm command" )
39
+ runCommand .PersistentFlags ().BoolVarP (& runWithBun , "bun" , "b" , false , "Run npm commands with Bun" )
38
40
runCommand .PersistentFlags ().StringArrayVarP (& names , "label" , "l" , []string {}, "label prefix for the command" )
39
41
runCommand .PersistentFlags ().BoolVarP (& noLabel , "no-label" , "B" , false , "do not attach label/prefix to output" )
40
42
rootCmd .AddCommand (& runCommand )
@@ -79,7 +81,11 @@ func collectCommands(args []string) ([]string, []string, error) {
79
81
80
82
for _ , script := range matchingScripts {
81
83
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
+ }
83
89
}
84
90
85
91
continue
0 commit comments