mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-11-25 17:23:35 +01:00
fix(tailscale): load completion when tailscale
is an alias (#12726)
This makes it work when Tailscale is installed via App Store: https://tailscale.com/kb/1080/cli?tab=macos. Co-authored-by: Marc Cornellà <marc@mcornella.com>
This commit is contained in:
parent
081d704f32
commit
e636eeb696
@ -1,4 +1,4 @@
|
|||||||
if (( ! $+commands[tailscale] )); then
|
if (( ! $+commands[tailscale] && ! $+aliases[tailscale] )); then
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -7,7 +7,12 @@ fi
|
|||||||
if [[ ! -f "$ZSH_CACHE_DIR/completions/_tailscale" ]]; then
|
if [[ ! -f "$ZSH_CACHE_DIR/completions/_tailscale" ]]; then
|
||||||
typeset -g -A _comps
|
typeset -g -A _comps
|
||||||
autoload -Uz _tailscale
|
autoload -Uz _tailscale
|
||||||
_comps[tailscale]=_tailscale
|
|
||||||
|
if (( $+commands[tailscale] )); then
|
||||||
|
_comps[tailscale]=_tailscale
|
||||||
|
elif (( $+aliases[tailscale] )); then
|
||||||
|
_comps[${aliases[tailscale]:t}]=_tailscale
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
tailscale completion zsh >| "$ZSH_CACHE_DIR/completions/_tailscale" &|
|
tailscale completion zsh >| "$ZSH_CACHE_DIR/completions/_tailscale" &|
|
||||||
|
Loading…
Reference in New Issue
Block a user