mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-01-23 02:35:38 +01:00
Use convention for completion file
This commit is contained in:
parent
95bed78e58
commit
c03a945a3c
1 changed files with 9 additions and 8 deletions
|
|
@ -1,16 +1,17 @@
|
|||
# Pulumi oh-my-zsh plugin (short aliases)
|
||||
|
||||
if ! command -v pulumi &> /dev/null; then
|
||||
if (( ! $+commands[pulumi] )); then
|
||||
return
|
||||
fi
|
||||
|
||||
# Load completion if available
|
||||
if pulumi gen-completion zsh &> /dev/null; then
|
||||
autoload -U +X compinit && compinit
|
||||
pulumi gen-completion zsh >! "${ZSH_CACHE_DIR:-$HOME/.zsh_cache}/_pulumi"
|
||||
fpath=("${ZSH_CACHE_DIR:-$HOME/.zsh_cache}" $fpath)
|
||||
# If the completion file doesn't exist yet, we need to autoload it and
|
||||
# bind it to `pulumi`. Otherwise, compinit will have already done that.
|
||||
if [[ ! -f "$ZSH_CACHE_DIR/completions/_pulumi" ]]; then
|
||||
typeset -g -A _comps
|
||||
autoload -Uz _pulumi
|
||||
_comps[pulumi]=_pulumi
|
||||
fi
|
||||
|
||||
pulumi gen-completion zsh >| "$ZSH_CACHE_DIR/completions/_pulumi" &|
|
||||
|
||||
# Aliases
|
||||
alias p='pulumi'
|
||||
alias pu='pulumi up'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue