Skip to content

Commit

Permalink
fix: Improve wording when installing binary
Browse files Browse the repository at this point in the history
fixes #493
  • Loading branch information
yermulnik committed Jul 18, 2024
1 parent 8137e26 commit 7b47142
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/symlink.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,11 @@ func ChangeSymlink(binVersionPath string, binPath string) {
func ChangeProductSymlink(product Product, binVersionPath string, userBinPath string) error {
homedir := GetHomeDirectory() // get user's home directory
homeBinPath := filepath.Join(homedir, "bin", product.GetExecutableName())
possibleInstallLocations := []string{userBinPath, homeBinPath}
possibleInstallLocations := []string{Path(userBinPath), Path(homeBinPath)}
var err error

for _, location := range possibleInstallLocations {
if CheckDirExist(Path(location)) {
if CheckDirExist(location) {
/* remove current symlink if exist*/
symlinkExist := CheckSymlink(location)
if symlinkExist {
Expand All @@ -122,8 +122,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.Printf("None of the installation directories exist: \"%s\". %s\n",

Check failure on line 125 in lib/symlink.go

View workflow job for this annotation

GitHub Actions / fmt_and_vet

too many return values

Check failure on line 125 in lib/symlink.go

View workflow job for this annotation

GitHub Actions / fmt_and_vet

too many return values

Check failure on line 125 in lib/symlink.go

View workflow job for this annotation

GitHub Actions / integration_tests_linux (ubuntu-latest, 1.22)

too many return values

Check failure on line 125 in lib/symlink.go

View workflow job for this annotation

GitHub Actions / integration_tests_windows (windows-latest, 1.22)

too many return values
strings.Join(possibleInstallLocations, `", "`),
"Manually create one of them and try again.")
}

Expand Down

0 comments on commit 7b47142

Please sign in to comment.