Skip to content

Commit

Permalink
Refactor executable file path
Browse files Browse the repository at this point in the history
  • Loading branch information
thedevsaddam committed Nov 3, 2021
1 parent 935fd18 commit 2aeced0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ require (
github.com/Masterminds/semver v1.5.0
github.com/briandowns/spinner v1.16.0
github.com/deckarep/gosx-notifier v0.0.0-20180201035817-e127226297fb // indirect
github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0
github.com/martinlindhe/notify v0.0.0-20181008203735-20632c9a275a
github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d // indirect
github.com/schollz/progressbar/v3 v3.8.3
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,8 @@ github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1
github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
github.com/k0kubun/go-ansi v0.0.0-20180517002512-3bf9e2903213/go.mod h1:vNUNkEQ1e29fT/6vq2aBdFsgNPmy8qMdSay1npru+Sw=
github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 h1:iQTw/8FWTuc7uiaSepXwyf3o52HaUYcV+Tu66S3F5GA=
github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0/go.mod h1:1NbS8ALrpOvjt0rHPNLyCIeMtbizbir8U//inJ+zuB8=
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg=
Expand Down
4 changes: 3 additions & 1 deletion update/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import (
"os"
"path/filepath"
"time"

"github.com/kardianos/osext"
)

type (
Expand Down Expand Up @@ -83,7 +85,7 @@ func updateBinary(ctx context.Context, url string) error {
return errors.New("update: failed to fetch binary file")
}

dir, err := filepath.Abs(filepath.Dir(os.Args[0]))
dir, err := osext.ExecutableFolder()
if err != nil {
return err
}
Expand Down

0 comments on commit 2aeced0

Please sign in to comment.