Skip to content

Commit

Permalink
Do not delete local dir on uninstall
Browse files Browse the repository at this point in the history
  • Loading branch information
babarot committed Mar 10, 2023
1 parent 0cb8872 commit 7a29a32
Show file tree
Hide file tree
Showing 4 changed files with 196 additions and 864 deletions.
8 changes: 4 additions & 4 deletions cmd/self-update.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,10 @@ func (c *selfUpdateCmd) run(args []string) error {
return errors.New("failed to run self-update")
}

latest, found, err := selfupdate.DetectLatest(Repository)
ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt)
defer stop()

latest, found, err := selfupdate.DetectLatest(ctx, selfupdate.ParseSlug(Repository))
if err != nil {
return errors.Wrap(err, "error occurred while detecting version")
}
Expand All @@ -112,9 +115,6 @@ func (c *selfUpdateCmd) run(args []string) error {
return nil
}

ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt)
defer stop()

release, err := github.NewRelease(ctx, "b4b4r07", "afx", "v"+latest.Version(), github.WithVerbose())
if err != nil {
return err
Expand Down
96 changes: 69 additions & 27 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,42 +1,84 @@
module github.com/b4b4r07/afx

go 1.12
go 1.20

require (
github.com/AlecAivazis/survey/v2 v2.3.2
github.com/AlecAivazis/survey/v2 v2.3.6
github.com/MakeNowJust/heredoc v1.0.0
github.com/Masterminds/semver v1.5.0
github.com/Netflix/go-expect v0.0.0-20190729225929-0e00d9168667 // indirect
github.com/cli/cli/v2 v2.5.1
github.com/creativeprojects/go-selfupdate v0.6.1
github.com/cli/cli/v2 v2.24.3
github.com/creativeprojects/go-selfupdate v1.0.1
github.com/deckarep/golang-set v1.8.0
github.com/dsnet/compress v0.0.2-0.20210315054119-f66993602bf5 // indirect
github.com/fatih/color v1.13.0
github.com/frankban/quicktest v1.4.1 // indirect
github.com/go-playground/validator/v10 v10.4.1
github.com/goccy/go-yaml v1.9.5
github.com/google/go-cmp v0.5.7
github.com/h2non/filetype v1.0.10
github.com/fatih/color v1.14.1
github.com/go-playground/validator/v10 v10.11.2
github.com/goccy/go-yaml v1.10.0
github.com/google/go-cmp v0.5.9
github.com/h2non/filetype v1.1.3
github.com/hashicorp/go-multierror v1.1.1
github.com/hashicorp/go-version v1.3.0
github.com/hashicorp/hcl/v2 v2.11.1
github.com/hashicorp/go-version v1.6.0
github.com/hashicorp/logutils v1.0.0
github.com/hinshun/vt10x v0.0.0-20180809195222-d55458df857c // indirect
github.com/inconshreveable/go-update v0.0.0-20160112193335-8152e7eb6ccf
github.com/k0kubun/pp v3.0.1+incompatible
github.com/k0kubun/pp/v3 v3.2.0
github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de
github.com/mattn/go-isatty v0.0.14
github.com/mattn/go-isatty v0.0.17
github.com/mattn/go-shellwords v1.0.12
github.com/mattn/go-zglob v0.0.1
github.com/mattn/go-zglob v0.0.4
github.com/mholt/archiver v3.1.1+incompatible
github.com/nwaples/rardecode v1.1.0 // indirect
github.com/pierrec/lz4 v2.2.6+incompatible // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/russross/blackfriday v1.5.2
github.com/schollz/progressbar/v3 v3.8.6
github.com/spf13/cobra v1.3.0
github.com/ulikunitz/xz v0.5.9 // indirect
github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 // indirect
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211
github.com/pkg/errors v0.9.1
github.com/russross/blackfriday v1.6.0
github.com/schollz/progressbar/v3 v3.13.0
github.com/spf13/cobra v1.6.1
golang.org/x/sync v0.1.0
golang.org/x/term v0.6.0
gopkg.in/src-d/go-git.v4 v4.13.1
)

require (
code.gitea.io/sdk/gitea v0.15.1 // indirect
github.com/Masterminds/semver/v3 v3.2.0 // indirect
github.com/dsnet/compress v0.0.1 // indirect
github.com/emirpasic/gods v1.12.0 // indirect
github.com/frankban/quicktest v1.14.4 // indirect
github.com/go-playground/locales v0.14.1 // indirect
github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/go-github/v30 v30.1.0 // indirect
github.com/google/go-querystring v1.1.0 // indirect
github.com/hashicorp/errwrap v1.0.0 // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/hashicorp/go-retryablehttp v0.7.2 // indirect
github.com/inconshreveable/mousetrap v1.0.1 // indirect
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88 // indirect
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd // indirect
github.com/leodido/go-urn v1.2.1 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-runewidth v0.0.14 // indirect
github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d // indirect
github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/nwaples/rardecode v1.1.3 // indirect
github.com/pierrec/lz4 v2.6.1+incompatible // indirect
github.com/rivo/uniseg v0.4.3 // indirect
github.com/sergi/go-diff v1.0.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/src-d/gcfg v1.4.0 // indirect
github.com/ulikunitz/xz v0.5.11 // indirect
github.com/xanzy/go-gitlab v0.80.2 // indirect
github.com/xanzy/ssh-agent v0.2.1 // indirect
github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 // indirect
golang.org/x/crypto v0.6.0 // indirect
golang.org/x/net v0.8.0 // indirect
golang.org/x/oauth2 v0.5.0 // indirect
golang.org/x/sys v0.6.0 // indirect
golang.org/x/text v0.8.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.28.1 // indirect
gopkg.in/src-d/go-billy.v4 v4.3.2 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
)
Loading

0 comments on commit 7a29a32

Please sign in to comment.