From 4df6073f9c6ad6c682930bfe69d0ce679e42080e Mon Sep 17 00:00:00 2001 From: MCorange Date: Sun, 25 Aug 2024 23:52:04 +0300 Subject: [PATCH] :3 --- bindings.lua | 2 +- rtmc.lua | 6 ++---- src/updater.lua | 6 ++---- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/bindings.lua b/bindings.lua index a0871c7..b63ae55 100644 --- a/bindings.lua +++ b/bindings.lua @@ -12,7 +12,7 @@ --- @field debug fun(...) --- @class Updater ---- @field addEntry fun(path: string, branch: string, url: string) +--- @field addEntry fun(self: Updater, path: string, branch: string, url: string) --- @class JsonParser --- @field decode fun(s: string): table diff --git a/rtmc.lua b/rtmc.lua index 2da3151..911eb06 100644 --- a/rtmc.lua +++ b/rtmc.lua @@ -370,9 +370,7 @@ rawset(__BUNDLER_FILES, "updater", function () branch = branch, url = url }; - if not fs.exists(path) then - self:update(path, url); - end + self:update(path, url); end function updater:checkAndUpdateAll() local updated = false; @@ -402,7 +400,7 @@ rawset(__BUNDLER_FILES, "updater", function () return false; end local body, berr = req.readAll(); - if not req then + if not body then log.error("Updater:check: Could not get body of request: " .. berr); return false; end diff --git a/src/updater.lua b/src/updater.lua index 1db8d0e..58b69d9 100644 --- a/src/updater.lua +++ b/src/updater.lua @@ -32,9 +32,7 @@ function updater:addEntry(path, branch, url) branch = branch, url = url }; - if not fs.exists(path) then - self:update(path, url); - end + self:update(path, url); end function updater:checkAndUpdateAll() @@ -68,7 +66,7 @@ function updater:check(branch) end local body, berr = req.readAll(); - if not req then + if not body then log.error("Updater:check: Could not get body of request: " .. berr); return false; end