fix: supress exist code in recordings and replays
This commit is contained in:
+3
-2
@@ -14,14 +14,15 @@ func newRecordCommand() *cobra.Command {
|
|||||||
return &cobra.Command{
|
return &cobra.Command{
|
||||||
Use: "record <path>",
|
Use: "record <path>",
|
||||||
Args: cobra.ExactArgs(1),
|
Args: cobra.ExactArgs(1),
|
||||||
RunE: func(_ *cobra.Command, args []string) error {
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
path := filepath.Clean(args[0])
|
path := filepath.Clean(args[0])
|
||||||
createdPath, err := mire.Record(path)
|
createdPath, err := mire.Record(path)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if errors.Is(err, mire.ErrRecordingDiscarded) {
|
if errors.Is(err, mire.ErrRecordingDiscarded) {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
return err
|
cmd.PrintErrln(err)
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
output.Println(createdPath)
|
output.Println(createdPath)
|
||||||
|
|||||||
+6
-2
@@ -10,13 +10,17 @@ func newTestCommand() *cobra.Command {
|
|||||||
return &cobra.Command{
|
return &cobra.Command{
|
||||||
Use: "test [path]",
|
Use: "test [path]",
|
||||||
Args: cobra.MaximumNArgs(1),
|
Args: cobra.MaximumNArgs(1),
|
||||||
RunE: func(_ *cobra.Command, args []string) error {
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
path := ""
|
path := ""
|
||||||
if len(args) == 1 {
|
if len(args) == 1 {
|
||||||
path = args[0]
|
path = args[0]
|
||||||
}
|
}
|
||||||
|
|
||||||
return mire.RunTests(path)
|
if err := mire.RunTests(path); err != nil {
|
||||||
|
cmd.PrintErrln(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user