This commit is contained in:
Gvidas Juknevičius 2024-08-25 22:10:22 +03:00
parent 009d9d6071
commit bb8aceb832
Signed by: MCorange
GPG Key ID: 12B1346D720B7FBB
2 changed files with 6 additions and 2 deletions

View File

@ -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();

View File

@ -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);