Skip to content

Commit

Permalink
Merge "PATH" with Window's "Path".
Browse files Browse the repository at this point in the history
This enables searching for exes in not just runtime PATH, but also Windows Path.
  • Loading branch information
mitchell-as committed Aug 27, 2024
1 parent bd82284 commit aa415e3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/runtime/internal/envdef/environment.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"maps"
"os"
"path/filepath"
"runtime"
"strings"

"github.com/ActiveState/cli/internal/errs"
Expand Down Expand Up @@ -340,7 +341,11 @@ func (ed *EnvironmentDefinition) GetEnvBasedOn(envLookup map[string]string) (map
for _, ev := range ed.Env {
pev := &ev
if pev.Inherit {
osValue, hasOsValue := envLookup[pev.Name]
name := pev.Name
if runtime.GOOS == "windows" && name == "PATH" {
name = "Path" // env vars are case-insensitive on Windows, and this is what it uses
}
osValue, hasOsValue := envLookup[name]
if hasOsValue {
osEv := ev
osEv.Values = []string{osValue}
Expand Down

0 comments on commit aa415e3

Please sign in to comment.