diff --git a/cmd/commands/activate.go b/cmd/commands/activate.go index e49159c9..51a5bea7 100644 --- a/cmd/commands/activate.go +++ b/cmd/commands/activate.go @@ -18,11 +18,12 @@ package commands import ( "fmt" - "github.com/version-fox/vfox/internal" "os" "strings" "text/template" + "github.com/version-fox/vfox/internal" + "github.com/urfave/cli/v2" "github.com/version-fox/vfox/internal/env" "github.com/version-fox/vfox/internal/shell" @@ -53,6 +54,7 @@ func activateCmd(ctx *cli.Context) error { sdkPaths := envKeys["PATH"] if sdkPaths != nil { paths := manager.EnvManager.Paths([]string{*sdkPaths, originPath}) + envKeys["PATH"] = &paths } diff --git a/internal/env/windows_env.go b/internal/env/windows_env.go index 63e7e2e4..f9a8cf6c 100644 --- a/internal/env/windows_env.go +++ b/internal/env/windows_env.go @@ -189,16 +189,7 @@ func (w *windowsEnvManager) broadcastEnvironment() error { return nil } -func (w *windowsEnvManager) pathEnvValue() string { - var paths []string - for path := range w.pathMap { - paths = append(paths, path) - } - return w.Paths(paths) -} - func (w *windowsEnvManager) Paths(paths []string) string { - paths = append(paths, s) return strings.Join(paths, ";") }