feat(flutter): use up-to-date zsh completion (#11062)

This commit is contained in:
Christopher Boyd
2022-07-27 12:06:28 -04:00
committed by GitHub
parent bb6c14cdfd
commit af2daa7ab7
2 changed files with 15 additions and 37 deletions

View File

@ -12,3 +12,18 @@ alias flrd="flutter run --debug"
alias flrp="flutter run --profile"
alias flrr="flutter run --release"
alias flupgrd="flutter upgrade"
# COMPLETION FUNCTION
if (( ! $+commands[flutter] )); then
return
fi
# If the completion file doesn't exist yet, we need to autoload it and
# bind it to `flutter`. Otherwise, compinit will have already done that.
if [[ ! -f "$ZSH_CACHE_DIR/completions/_flutter" ]]; then
typeset -g -A _comps
autoload -Uz _flutter
_comps[flutter]=_flutter
fi
flutter zsh-completion >| "$ZSH_CACHE_DIR/completions/_flutter" &|