aliae
aliae copied to clipboard
feat: if improvements
Prerequisites
- [x] I have read and understood the contributing guide.
- [x] The commit message follows the conventional commits guidelines.
- [x] Tests for the changes have been added (for bug fixes / features).
- [x] Docs have been added/updated (for bug fixes / features).
Main new features
-
Ifnow supports both a string and a list - slim-sprig added to templates
- new runtime variables (.User, .ConfigDir, .CacheDir, .Hostname)
Ifs
This allows If to be a string as it currently is:
alias:
- name: hello
value: world
if: eq .Shell "zsh"
But also allows it to be a list:
alias:
- name: hello
value: world
if:
- eq .Shell "zsh"
- match .User "root"
slim-sprig
This incorporates slim-sprig template functions into templates. The slim version was chosen since most of the features in the full version that are missing are expensive and unneeded.
New runtime variables
-
.User-- The username of the current user -
.Hostname-- The current machine's hostname -
.ConfigDir-- The current user's config directory based on OS- Unix:
$XDG_CONFIG_HOME(or$HOME/.configif empty) - MacOS:
$HOME/Library/Application Support - Windows:
%AppData%
- Unix:
-
.CacheDir-- The current user's cache directory based on OS- Unix:
$XDG_CACHE_HOME(or$HOME/.cacheif empty) - MacOS:
$HOME/Library/Caches - Windows:
%LocalAppData%
- Unix:
Additional changes
- Refactored the various rendering switches to be in one place, allowing for new shells to be added easier. Also added interfaces for the various "types" of exports to conform to
Renderer - Added install instructions for the zinit
zshplugin manager