Compare commits

...

6 Commits

Author SHA1 Message Date
8c8221f789 wrong repo oopsies 2025-06-02 00:31:44 +00:00
af8d46154c Add App Store.lua 2025-06-02 00:31:15 +00:00
ebf3f8a35a :3 2024-08-26 00:18:19 +03:00
63704f0447 :3 2024-08-26 00:18:11 +03:00
59dc5edde5 :3 2024-08-25 23:56:48 +03:00
4df6073f9c :3 2024-08-25 23:52:04 +03:00
4 changed files with 9 additions and 12 deletions

View File

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

View File

@@ -41,7 +41,7 @@ rawset(__BUNDLER_FILES, "main", function ()
updaterLoop(upd)
end,
function ()
require(MODULE_NAME)(lib_exports);
require(MODULE_NAME).main(lib_exports);
end
);
end
@@ -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
@@ -418,6 +416,7 @@ rawset(__BUNDLER_FILES, "updater", function ()
log.debug("Commit hash matches");
log.debug(data[1].sha .. " (old) => (new) " .. self.curr_commit_hash);
end
write(".");
return false;
end
function updater:update(path, url)

View File

@@ -39,7 +39,7 @@ local function _start()
updaterLoop(upd)
end,
function ()
require(MODULE_NAME)(lib_exports);
require(MODULE_NAME).main(lib_exports);
end
);
end

View File

@@ -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
@@ -85,7 +83,7 @@ function updater:check(branch)
log.debug("Commit hash matches");
log.debug(data[1].sha .. " (old) => (new) " .. self.curr_commit_hash);
end
write(".");
return false;
end