Skip to content

Commit

Permalink
fixing update()
Browse files Browse the repository at this point in the history
  • Loading branch information
gesslar committed Jun 25, 2024
1 parent d1fceda commit 068f6a3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
2 changes: 1 addition & 1 deletion mfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"package": "ThreshBeep",
"title": "Make a sound when the beep is made!",
"description": "Make a sound when the beep is made!",
"version": "1.3.0",
"version": "1.4.0",
"author": "Gesslar@ThresholdRPG",
"icon": "griffon-right.jpg",
"dependencies": "",
Expand Down
21 changes: 9 additions & 12 deletions src/scripts/Updater.lua
Original file line number Diff line number Diff line change
Expand Up @@ -94,25 +94,22 @@ function __PKGNAME__.Mupdate:RegisterMupdateEventHandlers()
end
end

function __PKGNAME__.update()
local mupdate = require("__PKGNAME__.Mupdate")

cecho(f"<chocolate>[[ __PKGNAME__ ]]<reset> Initiating manual update.\n")
cecho(f"<chocolate>[[ __PKGNAME__ ]]<reset> Full logging of update activity may be found in <u>Scripts</u> > <u>Errors</u>\n")

__PKGNAME__.Mupdate:downloadLatestMupdate()
end

function __PKGNAME__.Mupdate:UnregisterMupdateEventHandlers()
local existingHandlers = getNamedEventHandlers(self.tag) or {}
for _, label in pairs(self.handler_events) do
local result = deleteNamedEventHandler(self.tag, label)
if not result then
display("Failed to unregister: " .. label)
end
end
end

function __PKGNAME__.update()
local version = getPackageInfo("__PKGNAME__", "version")
cecho(f"<chocolate>[[ __PKGNAME__ ]]<reset> Initiating manual update to currently installed version "..version..".\n")
cecho(f"<chocolate>[[ __PKGNAME__ ]]<reset> If there is a new version, it will be downloaded and installed.\n")
cecho(f"<chocolate>[[ __PKGNAME__ ]]<reset> Full logging of update activity may be found in <u>Scripts</u> > <u>Errors</u>\n")

__PKGNAME__.Mupdate:downloadLatestMupdate()
end

function __PKGNAME__.Mupdate:downloadLatestMupdate()
local success, err = pcall(os.remove, self.local_path)

Expand Down

0 comments on commit 068f6a3

Please sign in to comment.