version-fox / vfox

A cross-platform and extendable version manager with support for Java, Node.js, Flutter, .Net & more
https://vfox.lhan.me
Apache License 2.0
2.66k stars 93 forks source link

[BUG]: some of the packages are not changing accordingly #337

Open padulkemid opened 1 month ago

padulkemid commented 1 month ago

Version 0.5.4 OS macOS

Describe the bug Won't change version, always fallback to machine's env like java to usr/bin/java and nodejs to usr/local/bin/node.

Is there anything wrong with my setup? since I just brew update && brew upgrade everything yesterday? (might be an issue with some packages that always falling back to default version?)

Screenshots[optional] image

padulkemid commented 1 month ago

confirmed: work with kotlin and golang, just java and nodejs

padulkemid commented 1 month ago

image

it appears vfox 's dir in $PATH are added in below from the bin, should we move it to the topmost path?

padulkemid commented 1 month ago

I think this commit is from months ago and the version before works fine, is this PATH changing state are handled in here?

pathSet := env.NewPaths(env.EmptyPaths)
  for _, item := range items {
    if item.Key == "PATH" {
        pathSet.Add(item.Value)
    } else {
        envKeys.Variables[item.Key] = &item.Value
    }
  }

envKeys.Paths = pathSet