Skip to content

Commit

Permalink
fix: fix bug of env in Windows cmd, close #43
Browse files Browse the repository at this point in the history
  • Loading branch information
ilharp committed Jun 7, 2022
1 parent 5bf747c commit 7a4943b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/koi/daemon/koi_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,9 @@ func CreateKoiCmd(
for {
notFound := true
for i, e := range env {
if strings.HasPrefix(e, "PATH=") {
if strings.HasPrefix(e, "PATH=") ||
strings.HasPrefix(e, "Path=") ||
strings.HasPrefix(e, "path=") {
pathEnv = e[5:]
env = append(env[:i], env[i+1:]...)
notFound = false
Expand Down
1 change: 1 addition & 0 deletions packages/koi/util/env/useenv.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ func UseEnv(env *[]string, key string, value string) {

func RemoveEnv(env *[]string, key string) {
removeEnvIntl(env, key)
removeEnvIntl(env, strings.Title(strings.ToLower(key))) // hElLo => Hello
removeEnvIntl(env, strings.ToUpper(key))
removeEnvIntl(env, strings.ToLower(key))
}
Expand Down

0 comments on commit 7a4943b

Please sign in to comment.