Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Commits on Apr 29, 2023

  1. feat: add %symbol% substituting to non-clone time ices like atload, etc

    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
    ```
    psprint committed Apr 29, 2023
    Configuration menu
    Copy the full SHA
    6de002d View commit details
    Browse the repository at this point in the history