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
Feature: Add support for local plugin installation #2520
Conversation
Signed-off-by: Florian Grabmeier <flo.grabmeier@gmail.com>
Open questions
|
I am thinking: The icon is not displayed correctly in the installation command because the path from the zip file cannot be used Use a custom icon, or can we load the zip icon? How should update recommendations be handled (should it also be possible to use pm update , as this is automatically suggested if the plugin is already installed) Detect if it's local path, think Explorer plugin already has code to detect if it's local/network path. We can reuse it but move it to the SharedCommands folder in the Plugin project. After the installation the zip is always deleted, which may not be desired, how to avoid this? Cleaning up the zip file is by design when downloaded from URL. If local/network path is detected, skip this step. |
Signed-off-by: Florian Grabmeier <flo.grabmeier@gmail.com>
The problem with the icon is that the path to the png would be correct, but it has to be unzipped before it can be displayed. For this it would have to be temporary stored. I think the easiest way is to simply display a custom icon
Unfortunately I have not found a method in Explorer to detect if it is a local path (currently I use
Thanks |
This comment has been minimized.
This comment has been minimized.
Yeah that's what I mean, custom icon or just load the icon of the zip file? |
Yes, thanks, I have done that |
Where are the other icons from? Maybe I need to either add attribution (but I don't know where) or use a different icon since this icon uses the "flaticon license" which is free for commercial use but requires attribution |
@onesounds could you please lend a hand with icons? |
@flooxo this is what you need:
|
Could you explain why we need a local path in the plugin's manifest? Shouldn't allowing |
The local path is required because when calling |
Thanks! But this function does not check whether the location exists, which is crucial. |
Would it be best to use |
What would be the advantage of this? |
This method is best used to check if the query string is a location path, if not then proceed to download, if it is then you do a separate call to check if the file actually exists. This is so you don't end up checking file exists on disk per every query string. So call that function on the passed in query string, if is location path then call this
|
Not sure if I am understanding correctly, but I would say the expected user experience would be to use |
Just a thought, whether |
Yes, sure. I've already thought about this point, but I think if you can install a plugin locally, then it should also be possible to update it for the sake of completeness. Of course, it would be easier to simply drag it into the folder. |
Hey @flooxo I would like to make a couple changes and refactor the code on this PR, do you like me to commit them here directly or show you via a new PR? |
Feel free to commit them directly here to keep things simple :) |
@flooxo hey I pushed my changes, they include:
Let me know if you see any issues with them. |
Nice, LGTM :) |
This PR closes #2252.
Description
The new method uses
plugin.UrlDownload
to store the local path of the zip file.First, the corresponding values are read from the
plugin.json
file. Then it is installed like any other plugin, except that the zip file is not downloaded.Changes
Add a new method so that plugins can now also be installed locally from a zip file
Example:
pm install c:\plugin.zip
.