Compare commits
6 Commits
dfa9e305ab
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 8c8221f789 | |||
| af8d46154c | |||
|
ebf3f8a35a
|
|||
|
63704f0447
|
|||
|
59dc5edde5
|
|||
|
4df6073f9c
|
@@ -12,7 +12,7 @@
|
|||||||
--- @field debug fun(...)
|
--- @field debug fun(...)
|
||||||
|
|
||||||
--- @class Updater
|
--- @class Updater
|
||||||
--- @field addEntry fun(path: string, branch: string, url: string)
|
--- @field addEntry fun(self: Updater, path: string, branch: string, url: string)
|
||||||
|
|
||||||
--- @class JsonParser
|
--- @class JsonParser
|
||||||
--- @field decode fun(s: string): table
|
--- @field decode fun(s: string): table
|
||||||
|
|||||||
7
rtmc.lua
7
rtmc.lua
@@ -41,7 +41,7 @@ rawset(__BUNDLER_FILES, "main", function ()
|
|||||||
updaterLoop(upd)
|
updaterLoop(upd)
|
||||||
end,
|
end,
|
||||||
function ()
|
function ()
|
||||||
require(MODULE_NAME)(lib_exports);
|
require(MODULE_NAME).main(lib_exports);
|
||||||
end
|
end
|
||||||
);
|
);
|
||||||
end
|
end
|
||||||
@@ -370,10 +370,8 @@ rawset(__BUNDLER_FILES, "updater", function ()
|
|||||||
branch = branch,
|
branch = branch,
|
||||||
url = url
|
url = url
|
||||||
};
|
};
|
||||||
if not fs.exists(path) then
|
|
||||||
self:update(path, url);
|
self:update(path, url);
|
||||||
end
|
end
|
||||||
end
|
|
||||||
function updater:checkAndUpdateAll()
|
function updater:checkAndUpdateAll()
|
||||||
local updated = false;
|
local updated = false;
|
||||||
for path, entry in pairs(self.updated_files) do
|
for path, entry in pairs(self.updated_files) do
|
||||||
@@ -402,7 +400,7 @@ rawset(__BUNDLER_FILES, "updater", function ()
|
|||||||
return false;
|
return false;
|
||||||
end
|
end
|
||||||
local body, berr = req.readAll();
|
local body, berr = req.readAll();
|
||||||
if not req then
|
if not body then
|
||||||
log.error("Updater:check: Could not get body of request: " .. berr);
|
log.error("Updater:check: Could not get body of request: " .. berr);
|
||||||
return false;
|
return false;
|
||||||
end
|
end
|
||||||
@@ -418,6 +416,7 @@ rawset(__BUNDLER_FILES, "updater", function ()
|
|||||||
log.debug("Commit hash matches");
|
log.debug("Commit hash matches");
|
||||||
log.debug(data[1].sha .. " (old) => (new) " .. self.curr_commit_hash);
|
log.debug(data[1].sha .. " (old) => (new) " .. self.curr_commit_hash);
|
||||||
end
|
end
|
||||||
|
write(".");
|
||||||
return false;
|
return false;
|
||||||
end
|
end
|
||||||
function updater:update(path, url)
|
function updater:update(path, url)
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ local function _start()
|
|||||||
updaterLoop(upd)
|
updaterLoop(upd)
|
||||||
end,
|
end,
|
||||||
function ()
|
function ()
|
||||||
require(MODULE_NAME)(lib_exports);
|
require(MODULE_NAME).main(lib_exports);
|
||||||
end
|
end
|
||||||
);
|
);
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -32,9 +32,7 @@ function updater:addEntry(path, branch, url)
|
|||||||
branch = branch,
|
branch = branch,
|
||||||
url = url
|
url = url
|
||||||
};
|
};
|
||||||
if not fs.exists(path) then
|
|
||||||
self:update(path, url);
|
self:update(path, url);
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function updater:checkAndUpdateAll()
|
function updater:checkAndUpdateAll()
|
||||||
@@ -68,7 +66,7 @@ function updater:check(branch)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local body, berr = req.readAll();
|
local body, berr = req.readAll();
|
||||||
if not req then
|
if not body then
|
||||||
log.error("Updater:check: Could not get body of request: " .. berr);
|
log.error("Updater:check: Could not get body of request: " .. berr);
|
||||||
return false;
|
return false;
|
||||||
end
|
end
|
||||||
@@ -85,7 +83,7 @@ function updater:check(branch)
|
|||||||
log.debug("Commit hash matches");
|
log.debug("Commit hash matches");
|
||||||
log.debug(data[1].sha .. " (old) => (new) " .. self.curr_commit_hash);
|
log.debug(data[1].sha .. " (old) => (new) " .. self.curr_commit_hash);
|
||||||
end
|
end
|
||||||
|
write(".");
|
||||||
return false;
|
return false;
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user