Skip to content

Commit

Permalink
feat: impl no-style for the kcl test tool error result
Browse files Browse the repository at this point in the history
Signed-off-by: peefy <[email protected]>
  • Loading branch information
Peefy committed Nov 30, 2023
1 parent f4c2901 commit 31c6158
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmd/kcl/commands/test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
package cmd

import (
"errors"
"fmt"
"os"

"github.com/acarl005/stripansi"
"github.com/spf13/cobra"
"kcl-lang.io/cli/pkg/options"
kcl "kcl-lang.io/kcl-go"
Expand Down Expand Up @@ -79,6 +81,9 @@ func test(o *kcl.TestOptions, runOpts *options.RunOptions) error {
*depsOpt,
)
if err != nil {
if runOpts.NoStyle {
err = errors.New(stripansi.Strip(err.Error()))
}
return err
}
if len(result.Info) == 0 {
Expand Down

0 comments on commit 31c6158

Please sign in to comment.