1
0
mirror of https://github.com/rclone/rclone.git synced 2025-12-06 00:03:32 +00:00

selfupdate: add instructions on reverting the update (#5141)

This commit is contained in:
Ivan Andreev
2021-03-18 23:11:16 +03:00
committed by GitHub
parent 9ee3ad70e9
commit 2bdbf00fa3
2 changed files with 30 additions and 12 deletions

View File

@@ -146,15 +146,8 @@ func InstallUpdate(ctx context.Context, opt *Options) error {
return errors.Wrap(err, "unable to detect new version")
}
if newVersion == "" {
var err error
_, newVersion, _, err = versionCmd.GetVersion(siteURL + "/version.txt")
if err != nil {
return errors.Wrap(err, "unable to detect new version")
}
}
if newVersion == fs.Version {
oldVersion := fs.Version
if newVersion == oldVersion {
fmt.Println("rclone is up to date")
return nil
}
@@ -166,7 +159,7 @@ func InstallUpdate(ctx context.Context, opt *Options) error {
} else {
err := installPackage(ctx, opt.Beta, newVersion, siteURL, opt.Package)
if err == nil {
fmt.Printf("Successfully updated rclone package to version %s\n", newVersion)
fmt.Printf("Successfully updated rclone package from version %s to version %s\n", oldVersion, newVersion)
}
return err
}
@@ -218,7 +211,7 @@ func InstallUpdate(ctx context.Context, opt *Options) error {
err = replaceExecutable(targetFile, newFile, savedFile)
if err == nil {
fmt.Printf("Successfully updated rclone to version %s\n", newVersion)
fmt.Printf("Successfully updated rclone from version %s to version %s\n", oldVersion, newVersion)
}
return err
}