From f5580db32497a34846d9271f8b5a750d7b4b89c9 Mon Sep 17 00:00:00 2001 From: smartfrigde <37928912+smartfrigde@users.noreply.github.com> Date: Fri, 4 Feb 2022 19:47:16 +0100 Subject: [PATCH] Revert update on asar download fail --- src/Updater.nim | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Updater.nim b/src/Updater.nim index 8b87bc1..37c6dc5 100644 --- a/src/Updater.nim +++ b/src/Updater.nim @@ -27,6 +27,8 @@ proc downloadUpdate(endpoint:string) = writeFile("build_info.json", fetch(endpoint & "latest.json")) except Exception as e: echo("Failed to download the latest asar: ", e.msg) + moveFile("app.asar.old", "app.asar") + moveFile("build_info.json.old", "build_info.json") quit(1) echo ("Downloaded the latest asar. Checking checksums") if (parseJson(readFile("build_info.json"))["md5"].getStr() == getMD5(readFile("app.asar"))):