change: group environments

This commit is contained in:
debugtalk
2022-10-11 11:12:28 +08:00
parent 9b1f7d2d07
commit c2679a1508
8 changed files with 33 additions and 19 deletions
+3 -1
View File
@@ -11,6 +11,8 @@ import (
"github.com/pkg/errors"
"github.com/rs/zerolog/log"
"github.com/httprunner/httprunner/v4/hrp/internal/env"
)
func isPython3(python string) bool {
@@ -80,7 +82,7 @@ func ExecCommand(cmdName string, args ...string) error {
// add cmd dir path to $PATH
if cmdDir := filepath.Dir(cmdName); cmdDir != "" {
PATH := fmt.Sprintf("%s:%s", cmdDir, os.Getenv("PATH"))
PATH := fmt.Sprintf("%s:%s", cmdDir, env.PATH)
if err := os.Setenv("PATH", PATH); err != nil {
log.Error().Err(err).Msg("set env $PATH failed")
return err