-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
improve: add show-repo, upload, upgrade all #151
base: main
Are you sure you want to change the base?
Conversation
handle sysInstall and Uninstall events
-- if no errors removing then install | ||
if mpkg.remove(args) then | ||
tempTimer(2, function() mpkg.install(args) end) | ||
if args == "all" then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we block a package named all
from being submitted?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've turned this into the regex itself now, but it is probably wise as a precaution to block all
|
added case-insensitive to install, remove and show |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are get closer and closer!
The mpkg menu looks really clean now, great work with this @ZookaOnGit
end | ||
local sf = string.format | ||
|
||
mpkg.echo("Listing locally installed packages:") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would this also work? Packages can't be installed another way anyhow.
mpkg.echo("Listing locally installed packages:") | |
mpkg.echo("Listing installed packages:") |
|
||
for i = 1, #help do | ||
mpkg.echo(help[i]) | ||
end | ||
|
||
mpkg.echoLink("", "Visit https://packages.mudlet.org/upload to share your package.", function() mpkg.openWebUploads() end, "open browser at upload website", true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -338,8 +454,9 @@ function mpkg.search(args) | |||
for i = 1, #packages do | |||
if string.find(string.lower(packages[i]["mpackage"]), args, 1, true) or string.find(string.lower(packages[i]["title"]), args, 1, true) then | |||
mpkg.echo("") | |||
mpkg.echo("Package: <b>" .. packages[i]["mpackage"] .. "</b> (version: " .. packages[i]["version"] .. ")") | |||
mpkg.echo(" " .. packages[i]["title"] .. "") | |||
mpkg.echoLink(" ", f"<b>{packages[i]['mpackage']}</b> (v{packages[i]['version']}) ", function() mpkg.show(packages[i]["mpackage"], true) end, "show details", true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this is the problem with allowing non-versioned packages. If we enable updates to non-versioned packages we allow local user-made packages with the same name to possibly be overwritten.
Current workflow workaround we be to remove said package, then mpkg install <repo_version>
Also fixed the [install now] link message to only show when a searched package isn't installed locally.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where should we collect this kind of knowledge - perhaps a FAQ page for the package manager in the manual?
table.insert(mpkg.aliases, tempAlias("^(mpkg|mp) remove(?: (.+))?$", function() mpkg.remove(matches[3]) end)) | ||
table.insert(mpkg.aliases, tempAlias("^(mpkg|mp) show(?: (.+))?$", function() mpkg.show(matches[3]) end)) | ||
table.insert(mpkg.aliases, tempAlias("^(mpkg|mp) search(?: (.+))?$", function() mpkg.search(matches[3]) end)) | ||
--table.insert(mpkg.aliases, tempAlias("^(mpkg|mp) update$", function() mpkg.updatePackageList(false) end)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this one be commented out?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops, no
if not mpkg.silentFailures then | ||
mpkg.echo("Failed to download package listing.") | ||
mpkg.silentFailures = true | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was having network issues again and it was hard to diagnose without being able to see what the issue was, perhaps we use mpkg.debug for this?
end | |
end | |
if mpkg.debug then | |
mpkg.echo(f"Error downloading package listing: {arg[1]}") | |
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, right. That was so you didn't keep getting the message over and over due to automated listing updates, I did not think of that possibility doing it manually. I will make it show if called manually.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀 great work on this update!
getting closer! |
also handle sysInstall and sysUninstall events
Fixes #94
Fixes #146
Fixes #96
Fixes #80
Fixes #95