hasura.plugin.zsh 495 B

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