diff --git a/pkg/fetcher/fetch.go b/pkg/fetcher/fetch.go index 30a362b..fc3d8ee 100644 --- a/pkg/fetcher/fetch.go +++ b/pkg/fetcher/fetch.go @@ -93,6 +93,10 @@ func (f *fetcher) Fetch(cfgFile string, selectedTools ...string) error { f.checkUpxAvailable() } + if err := f.assureTargetDirAvailable(tb); err != nil { + return err + } + if err := f.deleteOldBinary(tb); err != nil { return err } @@ -100,9 +104,6 @@ func (f *fetcher) Fetch(cfgFile string, selectedTools ...string) error { if tb.Aliases != nil { aliases = *tb.Aliases } - if err := f.assureTargetDirAvailable(tb); err != nil { - return err - } ver, err := readVersions(tb.Target) if err != nil {