Skip to content

Install package from URL + drag and drop support#4724

Merged
Delwing merged 6 commits intoMudlet:developmentfrom
Delwing:download-package-install
Feb 2, 2021
Merged

Install package from URL + drag and drop support#4724
Delwing merged 6 commits intoMudlet:developmentfrom
Delwing:download-package-install

Conversation

@Delwing
Copy link
Copy Markdown
Contributor

@Delwing Delwing commented Jan 31, 2021

Brief overview of PR changes/additions

Easy way to install packages either through Lua api or drag & drop directly from site (drag link representation onto Mudlet).

download package demo 1
download package demo 2

Motivation for adding to Mudlet

Easier package installs.

Other info (issues closed, discussion etc)

@Delwing Delwing requested a review from a team as a code owner January 31, 2021 03:04
@Delwing Delwing requested review from a team January 31, 2021 03:04
@add-deployment-links
Copy link
Copy Markdown

add-deployment-links bot commented Jan 31, 2021

Hey there! Thanks for helping Mudlet improve. 🌟

Test versions

You can directly test the changes here:

No need to install anything - just unzip and run.
Let us know if it works well, and if it doesn't, please give details.

Copy link
Copy Markdown
Member

@vadi2 vadi2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great addition!


--- Installs package from url
-- @param url
function installPackageFromUrl(url)
Copy link
Copy Markdown
Member

@vadi2 vadi2 Jan 31, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd just make installPackage() handle it instead of a separate function, that would be more intuitive to work with for the players. You can override the C++ one in Lua in case the url is an online one. Search for local old in Lua for examples of Lua functions improving on the core C++ ones.

return
end

local destination = string.format("%s/%s.%s", lfs.currentdir(), fileName, suffix)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not safe to use binary location as the destination - it's not writeable on all platforms, for example this doesn't work on macOS (with an amazing error message /s):

image

I'd write it into the profile folder instead.

@Edru2
Copy link
Copy Markdown
Member

Edru2 commented Jan 31, 2021

I remember thinking about something similar about installing package directly from the mudlet package repo website by drag and drop (https://github.com/Mudlet/mudlet-package-repo)

This is a very good addition and will simplify installing packages a lot! 👍

Copy link
Copy Markdown
Member

@vadi2 vadi2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works well. Do you think you can trim it just to the file name or ideally the package name? You drag and drop a package from the internet and it starts talking about your profile folder, a bit strange :D

@Delwing
Copy link
Copy Markdown
Contributor Author

Delwing commented Jan 31, 2021

@vadi2 I've put stripping of getMudletHomeDir() from that way any other locations will have full message, mostly those downloaded through drag and drop an api call will be affected.

@vadi2
Copy link
Copy Markdown
Member

vadi2 commented Jan 31, 2021

Thanks for going above and beyond!

@Delwing Delwing merged commit 63b25f7 into Mudlet:development Feb 2, 2021
Chris7 pushed a commit to Chris7/Mudlet that referenced this pull request Jan 2, 2022
* add sysDropUrlEvent

* api to download package via drag and drop and url in general

* override instal package

* Update src/mudlet-lua/lua/Other.lua

Co-authored-by: Vadim Peretokin <vperetokin@gmail.com>

* strip profile home from file name in verbose package install

Co-authored-by: Piotr Wilczynski <piotr.wilczynski@bisnode.com>
Co-authored-by: Vadim Peretokin <vperetokin@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants