Skip to content

Commit

Permalink
fix: use version in home dir when no version found in root dir
Browse files Browse the repository at this point in the history
Fixes #1860
  • Loading branch information
Stratus3D committed Feb 4, 2025
1 parent e63aec6 commit 9c9c550
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions internal/resolve/resolve.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,17 @@ func Version(conf config.Config, plugin plugins.Plugin, directory string) (versi
}

nextDir := path.Dir(directory)
// If current dir and next dir are the same it means we've reached `/` and
// have no more parent directories to search.
if nextDir == directory {
// If no version found, try current users home directory. I'd like to
// eventually remove this feature.
homeDir, osErr := os.UserHomeDir()
if osErr != nil {
break
}

versions, found, err = findVersionsInDir(conf, plugin, homeDir)
break
}
directory = nextDir
Expand Down

0 comments on commit 9c9c550

Please sign in to comment.