Closed psprint closed 5 months ago
@vladdoster @pschmitt @alichtman: ping. What's your opinion on this egg
-like extension? Will it have any chance of merging?
The syntax for downloading miligram is:
zi mg"user/repo" for {FILE-NAME-ROOT}
For example, to load the n-commodore plugin that's currently shipped as miligram, one would do:
zi mg"psprint/n-commodore" keep for N-Commodore
The output of this command is:
==> (Requesting `N-Commodore-v1.47.mg', version: nc-1.44…)
Hi! …/tmp/.mount_N-CommLbx7te/n-commodore.plugin.zsh…
The "Hi…" message comes from the plugin.zsh file of the plugin.
One can also use "debug
" ice, the output will then be:
==> (Requesting `N-Commodore-v1.47.mg', version: nc-1.44…)
==> mg annex: args: N-Commodore
mg annex: Matched miligram to dir: /tmp/.mount_N-CommrJE53I
Hi! …/tmp/.mount_N-CommLbx7te/n-commodore.plugin.zsh…
What's currently left TODO is zi update
support.
@vladdoster @pschmitt @alichtman: I hope that you get from vacation soon :smile:
Description
This is the first commit that introduces the miligrams support via new, embedded (shipped and loaded by default)
mg
annex. In this commit what's implemented is:zi for my-plugin.mg
syntax, with a variation ofzi mg for my-plugin
,keep
ice (i.e.:zi keep for my-plugin.mg
),xmg
, that can build the miligram (viazi xmg build
in the plugin dir), and also:zi xmg extract my-plugin
).What's left is only allowing download of the miligrams from the GitHub Releases page. The planned syntax for this is:
zi mg"user/repo" for my-plugin
, that would look into the binary files and look up the most recent version ofmy-plugin.mg
, like e.g.:my-plugin-v1.7.mg
. The code already looks up the most recent version of the package, sozi for my-plugin.mg
will loadmy-plugin-1.7.mg
if it's the most recent version.Related Issue(s)
553
Motivation and Context
I think that to have the plugins like eggs in python is a good update on the plugins in Zsh world. We can exploit the already existing, well spread and supported AppImages' features, like:
appimagetool
,…to provide an
egg
like solution to Zsh.I've implemented the feature as annex that's shipped with zinit. It's located in
zinit.git/lib/annex/mg
and is automatically loaded at end ofzinit.zsh
. It is abefore-load
hook, likeunscope
annex.Usage examples
How Has This Been Tested?
By interactive use.
Types of changes
Checklist: