mirror of
https://github.com/restic/restic.git
synced 2026-11-05 23:09:22 +00:00
self-update: Check current version before download
This commit is contained in:
1 parent
7d0f2eaf24
commit
a432b42c81
2 files changed
+10
-3
No files matched your search
@@ -60,12 +60,14 @@ func runSelfUpdate(opts SelfUpdateOptions, gopts GlobalOptions, args []string) e
|
||||
|
||||
Printf("writing restic to %v\n", opts.Output)
|
||||
|
||||
v, err := selfupdate.DownloadLatestStableRelease(gopts.ctx, opts.Output, Verbosef)
|
||||
v, err := selfupdate.DownloadLatestStableRelease(gopts.ctx, opts.Output, version, Verbosef)
|
||||
if err != nil {
|
||||
return errors.Fatalf("unable to update restic: %v", err)
|
||||
}
|
||||
|
||||
Printf("successfully updated restic to version %v\n", v)
|
||||
if v != version {
|
||||
Printf("successfully updated restic to version %v\n", v)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
Reference in new issue
Block a user