-
Notifications
You must be signed in to change notification settings - Fork 3
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: if improvements #111
base: main
Are you sure you want to change the base?
Conversation
return Current.Hostname | ||
} | ||
hostname, err := os.Hostname() | ||
if err == nil && len(hostname) > 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
len(hostname) > 0
is obsolete as we return ""
anyways on error. So I don't see a change in behaviour.
return strs | ||
} | ||
|
||
func checkIf(i any) bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If If
is a custom type instead of interface{}
, this can also be a function on that type. Will make this cleaner. That will also allow to keep the a.If.Ignore()
statements.
Prerequisites
Main new features
If
now supports both a string and a listIfs
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:
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$XDG_CONFIG_HOME
(or$HOME/.config
if empty)$HOME/Library/Application Support
%AppData%
.CacheDir
-- The current user's cache directory based on OS$XDG_CACHE_HOME
(or$HOME/.cache
if empty)$HOME/Library/Caches
%LocalAppData%
Additional changes
Renderer
zsh
plugin manager