feat: print output with colors

This commit is contained in:
debugtalk
2022-04-22 20:18:01 +08:00
parent 03bdc6020f
commit 44276b6901
5 changed files with 40 additions and 46 deletions
+1 -15
View File
@@ -1,9 +1,6 @@
package hrp
import (
"os/exec"
"strings"
"github.com/pkg/errors"
"github.com/rs/zerolog/log"
@@ -25,18 +22,7 @@ func convert2PyTestScripts(paths ...string) error {
}
args := append([]string{"-m", "httprunner", "make"}, paths...)
cmd := exec.Command(python3, args...)
log.Info().Str("cmd", cmd.String()).Msg("convert to pytest scripts")
output, err := cmd.CombinedOutput()
if err != nil {
return errors.Wrap(err, "pytest running failed")
}
out := strings.TrimSpace(string(output))
println(out)
log.Info().Msg("convert to pytest scripts successfully")
return nil
return builtin.ExecCommand(python3, args...)
}
func convert2GoTestScripts(paths ...string) error {