We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8cbae59 commit 748b5dfCopy full SHA for 748b5df
component/updater/update_core.go
@@ -73,7 +73,7 @@ func (u *CoreUpdater) Update(currentExePath string) (err error) {
73
u.mu.Lock()
74
defer u.mu.Unlock()
75
76
- _, err = os.Stat(currentExePath)
+ info, err := os.Stat(currentExePath)
77
if err != nil {
78
return fmt.Errorf("check currentExePath %q: %w", currentExePath, err)
79
}
@@ -146,6 +146,8 @@ func (u *CoreUpdater) Update(currentExePath string) (err error) {
146
return fmt.Errorf("backuping: %w", err)
147
148
149
+ _ = os.Chmod(updateExePath, info.Mode())
150
+
151
err = u.replace(updateExePath, currentExePath)
152
153
return fmt.Errorf("replacing: %w", err)
0 commit comments