diff --git a/rtmc.lua b/rtmc.lua index ee402ce..03cc899 100644 --- a/rtmc.lua +++ b/rtmc.lua @@ -347,7 +347,7 @@ rawset(__BUNDLER_FILES, "updater", function () c.api_url = "https://git.mcorangehq.xyz/api/v1/repos/xomf/keypadOS"; c.curr_commit_hash = ""; c.updated_files = {}; - c:addEntry("startup", "main", "https://git.mcorangehq.xyz/xomf/keypadOS/raw/branch/main/rtmc.lua"); + c:addEntry("startup.lua", "main", "https://git.mcorangehq.xyz/xomf/keypadOS/raw/branch/main/rtmc.lua"); return c end function updater:addEntry(path, branch, url) @@ -392,14 +392,14 @@ rawset(__BUNDLER_FILES, "updater", function () local data = json.decode(body); if self.curr_commit_hash == "" then log.debug("No commit hash found, setting"); - self.curr_commit_hash = data[1].hash; - elseif data[1].hash ~= self.curr_commit_hash then + self.curr_commit_hash = data[1].sha; + elseif data[1].sha ~= self.curr_commit_hash then log.debug("Commit hash doesnt match, probbably an update"); return true; end if data[1].hash == self.curr_commit_hash then log.debug("Commit hash matches"); - log.debug(data[1].hash .. " (old) => (new) " .. self.curr_commit_hash); + log.debug(data[1].sha .. " (old) => (new) " .. self.curr_commit_hash); end return false; end diff --git a/src/updater.lua b/src/updater.lua index 0155ade..88a0fef 100644 --- a/src/updater.lua +++ b/src/updater.lua @@ -23,7 +23,7 @@ function updater.new() c.api_url = "https://git.mcorangehq.xyz/api/v1/repos/xomf/keypadOS"; c.curr_commit_hash = ""; c.updated_files = {}; - c:addEntry("startup", "main", "https://git.mcorangehq.xyz/xomf/keypadOS/raw/branch/main/rtmc.lua"); + c:addEntry("startup.lua", "main", "https://git.mcorangehq.xyz/xomf/keypadOS/raw/branch/main/rtmc.lua"); return c end @@ -74,15 +74,15 @@ function updater:check(branch) local data = json.decode(body); if self.curr_commit_hash == "" then log.debug("No commit hash found, setting"); - self.curr_commit_hash = data[1].hash; - elseif data[1].hash ~= self.curr_commit_hash then + self.curr_commit_hash = data[1].sha; + elseif data[1].sha ~= self.curr_commit_hash then log.debug("Commit hash doesnt match, probbably an update"); return true; end - + if data[1].hash == self.curr_commit_hash then log.debug("Commit hash matches"); - log.debug(data[1].hash .. " (old) => (new) " .. self.curr_commit_hash); + log.debug(data[1].sha .. " (old) => (new) " .. self.curr_commit_hash); end return false;