Skip to content
This repository has been archived by the owner on Nov 25, 2024. It is now read-only.

Commit

Permalink
handle appPath error
Browse files Browse the repository at this point in the history
  • Loading branch information
achhabra2 committed Dec 18, 2021
1 parent 1ba1276 commit 727766e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions internal/update/selfupdate.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,12 @@ func DoSelfUpdateMac() bool {
log.Println("curl error:", err)
return false
}
cmdPath, _ := os.Executable()
appPath := strings.TrimSuffix(cmdPath, "RiftShare.app/Contents/MacOS/RiftShare")
var appPath string
cmdPath, err := os.Executable()
appPath = strings.TrimSuffix(cmdPath, "RiftShare.app/Contents/MacOS/RiftShare")
if err != nil {
appPath = "/Applications/"
}
err = exec.Command("ditto", "-xk", downloadPath, appPath).Run()
if err != nil {
log.Println("ditto error:", err)
Expand Down

0 comments on commit 727766e

Please sign in to comment.