Support for installing plugins from .zip urls #46
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds support for installing plugins from .zip files hosted on the web.
This command would now work:
plug("https://github.com/TokisanGames/Terrain3D/releases/download/v1.0.0-stable/terrain3D-1.0.0-stable-godot4.3.zip")I noticed a lot of godot plugins are distributed as .zip files on github release pages, especially if they include compiled binaries. I figure it might be useful to let people install plugins that way.
I doubt this is of acceptable quality to merge, but I figured I would share my work in case it's interesting to you.
Other notes:
download_zipfunction shells out tocurlto download the zip file. Then it uses godot's builtin ZipReader to decompress.download_zipwas added to the_GitExecutableclass. That's kind of weird, but_GitExecutablealready had all the methods needed to shell out to an external command, so I just piggybacked off of it. Could maybe rename_GitExecutableto_ExternalExecutableor something.There's also an unrelated change in here. I added a new field to plugins called
on_updated_callablewhich works exactly likeon_updated, but takes a callable instead of a string. Happy to back that out if it's weird to have both changes in the same PR.