This commit is contained in:
Gvidas Juknevičius 2024-08-25 23:15:37 +03:00
parent 1c6af0a1f9
commit d99a1ee5bb
Signed by: MCorange
GPG Key ID: 12B1346D720B7FBB
2 changed files with 9 additions and 9 deletions

View File

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

View File

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