From bb8aceb8327406f7d22ed20f15f76f27558afc1f Mon Sep 17 00:00:00 2001 From: MCorange Date: Sun, 25 Aug 2024 22:10:22 +0300 Subject: [PATCH] :3 --- rtmc.lua | 4 +++- src/updater.lua | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/rtmc.lua b/rtmc.lua index e4529a6..81d0cb0 100644 --- a/rtmc.lua +++ b/rtmc.lua @@ -398,7 +398,9 @@ rawset(__BUNDLER_FILES, "updater.lua", function () if fs.exists(path .. ".bak") then fs.delete(path .. ".bak"); end - fs.copy(path, path..".bak"); + if fs.exists(path) then + fs.copy(path, path..".bak"); + end local fd = fs.open(path, "w"); fd.write(body); fd.close(); diff --git a/src/updater.lua b/src/updater.lua index 38a8340..15f661e 100644 --- a/src/updater.lua +++ b/src/updater.lua @@ -91,7 +91,9 @@ function updater:update(path, url) if fs.exists(path .. ".bak") then fs.delete(path .. ".bak"); end - fs.copy(path, path..".bak"); + if fs.exists(path) then + fs.copy(path, path..".bak"); + end local fd = fs.open(path, "w"); fd.write(body);