mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-11-19 21:41:07 +01:00
feat(helmfile): introduce helmfile plugin
This commit is contained in:
parent
7bbebcd520
commit
bae6eefd69
2 changed files with 34 additions and 0 deletions
16
plugins/helmfile/README.md
Normal file
16
plugins/helmfile/README.md
Normal file
|
@ -0,0 +1,16 @@
|
|||
# Helmfile plugin
|
||||
|
||||
This plugin adds completion and aliases for [Helmfile](https://helmfile.readthedocs.io/), the declarative helm charts deployer.
|
||||
|
||||
To use it, add `helmfile` to the plugins array in your zshrc file:
|
||||
|
||||
```zsh
|
||||
plugins=(... helmfile)
|
||||
```
|
||||
|
||||
## Aliases
|
||||
|
||||
| Alias | Full command |
|
||||
| ----- | ---------------------- |
|
||||
| hf | helmfile |
|
||||
| hfi | helmfile --interactive |
|
18
plugins/helmfile/helmfile.plugin.zsh
Normal file
18
plugins/helmfile/helmfile.plugin.zsh
Normal file
|
@ -0,0 +1,18 @@
|
|||
# Completion
|
||||
if (( ! $+commands[helmfile] )); then
|
||||
return
|
||||
fi
|
||||
|
||||
# If the completion file doesn't exist yet, we need to autoload it and
|
||||
# bind it to `helmfile`. Otherwise, compinit will have already done that.
|
||||
if [[ ! -f "$ZSH_CACHE_DIR/completions/_helmfile" ]]; then
|
||||
typeset -g -A _comps
|
||||
autoload -Uz _helmfile
|
||||
_comps[helmfile]=_helmfile
|
||||
fi
|
||||
|
||||
helmfile completion zsh >| "$ZSH_CACHE_DIR/completions/_helmfile" &|
|
||||
|
||||
# Aliases
|
||||
alias hf='helmfile'
|
||||
alias hfi='helmfile --interactive'
|
Loading…
Reference in a new issue