feat: add support for path arg in miro test
This commit is contained in:
+11
-4
@@ -1,6 +1,8 @@
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"path/filepath"
|
||||
|
||||
"miro/internal/miro"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
@@ -8,10 +10,15 @@ import (
|
||||
|
||||
func newTestCommand() *cobra.Command {
|
||||
return &cobra.Command{
|
||||
Use: "test",
|
||||
Args: cobra.NoArgs,
|
||||
RunE: func(_ *cobra.Command, _ []string) error {
|
||||
return miro.RunTests()
|
||||
Use: "test [path]",
|
||||
Args: cobra.MaximumNArgs(1),
|
||||
RunE: func(_ *cobra.Command, args []string) error {
|
||||
path := ""
|
||||
if len(args) == 1 {
|
||||
path = filepath.Clean(args[0])
|
||||
}
|
||||
|
||||
return miro.RunTests(path)
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user