hasura.plugin.zsh
495 bytes
1if (( ! $+commands[hasura] )); then
2 return
3fi
4
5# If the completion file does not exist, generate it and then source it
6# Otherwise, source it and regenerate in the background
7if [[ ! -f "$ZSH_CACHE_DIR/completions/_hasura" ]]; then
8 hasura completion zsh --file "$ZSH_CACHE_DIR/completions/_hasura" >/dev/null
9 source "$ZSH_CACHE_DIR/completions/_hasura"
10else
11 source "$ZSH_CACHE_DIR/completions/_hasura"
12 hasura completion zsh --file "$ZSH_CACHE_DIR/completions/_hasura" >/dev/null &|
13fi