Skip to content

Commit

Permalink
fix: Improve wording when installing binary (#494)
Browse files Browse the repository at this point in the history
* fix: Improve wording when installing binary

fixes #493

* Fix wrong copy&pasta

* Re-work to eliminate breakage
  • Loading branch information
yermulnik authored Jul 18, 2024
1 parent 9446e7e commit fe26f44
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/symlink.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,11 @@ func ChangeProductSymlink(product Product, binVersionPath string, userBinPath st
homedir := GetHomeDirectory() // get user's home directory
homeBinPath := filepath.Join(homedir, "bin", product.GetExecutableName())
possibleInstallLocations := []string{userBinPath, homeBinPath}
possibleInstallDirs := []string{}
var err error

for _, location := range possibleInstallLocations {
possibleInstallDirs = append(possibleInstallDirs, Path(location))
if CheckDirExist(Path(location)) {
/* remove current symlink if exist*/
symlinkExist := CheckSymlink(location)
Expand All @@ -122,8 +124,8 @@ func ChangeProductSymlink(product Product, binVersionPath string, userBinPath st
}

if err == nil {
return fmt.Errorf("Unable to find existing directory in %q. %s",
strings.Join(possibleInstallLocations, " or "),
return fmt.Errorf("None of the installation directories exist: \"%s\". %s\n",
strings.Join(possibleInstallDirs, `", "`),
"Manually create one of them and try again.")
}

Expand Down

0 comments on commit fe26f44

Please sign in to comment.