Skip to content

Commit

Permalink
fix: priority accurate matching version (#329)
Browse files Browse the repository at this point in the history
* fix: priority accurate matching version

* Revert `PreUse` hook
  • Loading branch information
Chance-fyi authored Sep 28, 2024
1 parent c9d1e06 commit e6f1588
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,10 @@ func (b *Sdk) PreUse(version Version, scope UseScope) (Version, error) {
// not want to change the version or not implement the PreUse function.
// We can simply fuzzy match the version based on the input version.
if newVersion == "" {
// Before fuzzy matching, perform exact matching first.
if b.CheckExists(version) {
return version, nil
}
installedVersions := make(util.VersionSort, 0, len(installedSdks))
for _, sdk := range installedSdks {
installedVersions = append(installedVersions, string(sdk.Main.Version))
Expand Down

0 comments on commit e6f1588

Please sign in to comment.