fix: supress exist code in recordings and replays

This commit is contained in:
2026-03-21 22:24:31 +00:00
parent 97a4696a1c
commit 254b9d28a5
2 changed files with 9 additions and 4 deletions
+3 -2
View File
@@ -14,14 +14,15 @@ func newRecordCommand() *cobra.Command {
return &cobra.Command{
Use: "record <path>",
Args: cobra.ExactArgs(1),
RunE: func(_ *cobra.Command, args []string) error {
RunE: func(cmd *cobra.Command, args []string) error {
path := filepath.Clean(args[0])
createdPath, err := mire.Record(path)
if err != nil {
if errors.Is(err, mire.ErrRecordingDiscarded) {
return nil
}
return err
cmd.PrintErrln(err)
return nil
}
output.Println(createdPath)
+6 -2
View File
@@ -10,13 +10,17 @@ func newTestCommand() *cobra.Command {
return &cobra.Command{
Use: "test [path]",
Args: cobra.MaximumNArgs(1),
RunE: func(_ *cobra.Command, args []string) error {
RunE: func(cmd *cobra.Command, args []string) error {
path := ""
if len(args) == 1 {
path = args[0]
}
return mire.RunTests(path)
if err := mire.RunTests(path); err != nil {
cmd.PrintErrln(err)
}
return nil
},
}
}