Skip to content

Commit

Permalink
Fix a bug that PATH on Windows will sometimes get overwritten (#152)
Browse files Browse the repository at this point in the history
* Fix a bug that PATH env is overwritten if it's name is `Path` (on Windows).
* Use strings.EqualFold instead of strings.ToUpper to do case-insensitive comparison.
  • Loading branch information
coeuvre authored Aug 18, 2020
1 parent 297a40a commit 6f5ce4b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bazelisk.go
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,7 @@ func prependDirToPathList(cmd *exec.Cmd, dir string) {
if len(splits) != 2 {
continue
}
if splits[0] == "PATH" {
if strings.EqualFold(splits[0], "PATH") {
found = true
cmd.Env[idx] = fmt.Sprintf("PATH=%s%s%s", dir, string(os.PathListSeparator), splits[1])
break
Expand Down

0 comments on commit 6f5ce4b

Please sign in to comment.