diff --git a/bindings.lua b/bindings.lua new file mode 100644 index 0000000..a0871c7 --- /dev/null +++ b/bindings.lua @@ -0,0 +1,23 @@ +--- @class Exports +--- @field log Logger +--- @field updater Updater +--- @field notifier Notifier +--- @field json JsonParser + + +--- @class Logger +--- @field error fun(...) +--- @field warn fun(...) +--- @field info fun(...) +--- @field debug fun(...) + +--- @class Updater +--- @field addEntry fun(path: string, branch: string, url: string) + +--- @class JsonParser +--- @field decode fun(s: string): table +--- @field encode fun(s: table): string + +--- @class Notifier +--- @field notify fun(priority: "1"|"2"|"3"|"4"|"5", body: string) + diff --git a/src/main.lua b/src/main.lua index 91be291..74a3793 100644 --- a/src/main.lua +++ b/src/main.lua @@ -10,11 +10,7 @@ if not __VERSION then __VERSION = "DEV"; end ---- @class Exports ---- @field log Logger ---- @field updater Updater ---- @field notifier Notifier ---- @field json JsonParser + --- @param upd Updater diff --git a/src/updater.lua b/src/updater.lua index d634c14..1db8d0e 100644 --- a/src/updater.lua +++ b/src/updater.lua @@ -72,7 +72,6 @@ function updater:check(branch) log.error("Updater:check: Could not get body of request: " .. berr); return false; end - local data = json.decode(body); if self.curr_commit_hash == "" then log.debug("No commit hash found, setting");