mirror of
https://github.com/octoleo/syncthing.git
synced 2024-12-22 10:58:57 +00:00
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3535
This commit is contained in:
parent
be38c2111f
commit
76b903b2e0
@ -198,6 +198,7 @@ func upgradeToURL(archiveName, binary string, url string) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer os.Remove(fname)
|
||||
|
||||
old := binary + ".old"
|
||||
os.Remove(old)
|
||||
@ -205,7 +206,11 @@ func upgradeToURL(archiveName, binary string, url string) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return os.Rename(fname, binary)
|
||||
if os.Rename(fname, binary); err != nil {
|
||||
os.Rename(old, binary)
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func readRelease(archiveName, dir, url string) (string, error) {
|
||||
|
Loading…
Reference in New Issue
Block a user