-
Notifications
You must be signed in to change notification settings - Fork 128
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
feat: Add %SYMBOL% substituting to non-clone time ices like atinit'', atload'', etc. #450
base: main
Are you sure you want to change the base?
Conversation
0ac46a6
to
b63a9a8
Compare
@psprint The commit fails on the linter https://github.com/zdharma-continuum/zinit/actions/runs/3802251129/jobs/6467549407#step:6:10 |
b63a9a8
to
134bf6c
Compare
134bf6c
to
5a28edb
Compare
It should now pass the linter. |
The commit message should be all lowercase. |
5a28edb
to
44f3b2e
Compare
@vladdoster: fixed |
@vladdoster I don't know why README.md isn't formatted, could you help? |
What is an actual use case for this? |
It's an ability to include special var-like strings like '%USER%' or
'%PLUGIN%' etc. In atload'',atinit'', etc. ices and not only in atclone''
etc. ices
sob., 29 kwi 2023, 06:26 użytkownik vladislav doster <
***@***.***> napisał:
… @psprint <https://github.com/psprint>,
What is an actual use case for this?
—
Reply to this email directly, view it on GitHub
<#450 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABOE4CGI6TNMNH4MXX436MDXDSKA5ANCNFSM6AAAAAATMI77DU>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@vladdoster Oh, I see that I've already described the feature in PR message. As for the use case, it's: e.g.: ability to just write
I think that such special vars are useful and needed from the point of view of versatility, to provide a complete support of the intentions of users (one could want such automatic plugin-name reference, for example). |
20cc9a5
to
d65c35a
Compare
@vladdoster: I've fixed the markdown in README.md (was exceeding 120 chars line lenght) |
There are many such symbol var-like symbols: - %ID% – id-as ice - %USER% – username (in user/plugin ID) - %PLUGIN% – plugin name (in user/plugin ID) - %URL% – snippet url - %DIR% – plugin directory path - %ZPFX% – value of $ZPFX - %OS% – `$OSTYPE` - %MACH% – `$MACHTYPE` - %CPU% – `$CPUTYPE` - %VENDOR% – `$VENDOR` - %HOST% – `$HOST` - %UID% – `$UID` (numerical user id) - %GID% – `$GID` (group #) With this patch many has been fixed (like %ID%, %USER%, %PLUGIN% were returning empty strings, possibly breaking packages, where this undocumented feature is used) and support for load-time ices (like `atload''`, etc.) have been added. For example: ```zsh zinit id-as'plugin-%UID%' atload'print Loaded from dir: %DIR%, plugin id: %ID%' for zdharma-continuum/null ``` output is: ``` Loaded from dir: /home/q/.local/share/zinit/plugins/plugin-500, plugin id: plugin-500 ```
d65c35a
to
6de002d
Compare
@vladdoste: Eh, mdformat is stil failing, I think that I'll give up, as I've run it without --check and then committed the result… Could you look? |
Description
There are many such symbol var-like symbols:
$OSTYPE
$MACHTYPE
$CPUTYPE
$VENDOR
$HOST
$UID
(numerical user id)$GID
(group #)With this patch many has been fixed (like %ID%, %USER%, %PLUGIN% were returning empty strings, possibly breaking packages, where this undocumented feature is used) and support for load-time ices (like
atload''
, etc.) have been added.Motivation and Context
I wanted to make %SYM% more widely used, it might yield interesting use cases. Maybe some new vars can be added? README is updated to mntion the feature.
Related Issue(s)
Usage examples
For example:
output is:
How Has This Been Tested?
Types of changes
Checklist: