Fix Windows auto-update to replace Navis.exe in place (1.8.1).
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -49,3 +49,14 @@ func Apply(ctx context.Context, manifestURL string) (string, error) {
|
||||
func shellQuote(s string) string {
|
||||
return "'" + strings.ReplaceAll(s, "'", `'\''`) + "'"
|
||||
}
|
||||
|
||||
// CleanupStaleDownloads removes leftover update temps from failed/old runs.
|
||||
func CleanupStaleDownloads() {
|
||||
exe, err := os.Executable()
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
exe, _ = filepath.Abs(exe)
|
||||
_ = os.Remove(exe + ".new")
|
||||
_ = os.Remove(filepath.Join(filepath.Dir(exe), ".navis-update-download"))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user