diff options
author | Tuowen Zhao <ztuowen@gmail.com> | 2023-01-17 12:46:15 +0100 |
---|---|---|
committer | Tuowen Zhao <ztuowen@gmail.com> | 2023-01-17 12:46:15 +0100 |
commit | db7efd2336e4dbe6abf321b00dbc11bc5afb1355 (patch) | |
tree | 720a58ff82bf0a0e0167594131f872d453b1828e /plugins/hasura/hasura.plugin.zsh | |
parent | 04b8c052e5b624873b352889423c753ed1baf9c4 (diff) | |
parent | 8f0e296dbf27026ea0515ebae0d3cc41f236ecdc (diff) | |
download | zsh-db7efd2336e4dbe6abf321b00dbc11bc5afb1355.tar.gz zsh-db7efd2336e4dbe6abf321b00dbc11bc5afb1355.tar.bz2 zsh-db7efd2336e4dbe6abf321b00dbc11bc5afb1355.zip |
Merge remote-tracking branch 'github/master'
Diffstat (limited to 'plugins/hasura/hasura.plugin.zsh')
-rw-r--r-- | plugins/hasura/hasura.plugin.zsh | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/plugins/hasura/hasura.plugin.zsh b/plugins/hasura/hasura.plugin.zsh new file mode 100644 index 000000000..18254c43b --- /dev/null +++ b/plugins/hasura/hasura.plugin.zsh @@ -0,0 +1,13 @@ +if (( ! $+commands[hasura] )); then + return +fi + +# If the completion file does not exist, generate it and then source it +# Otherwise, source it and regenerate in the background +if [[ ! -f "$ZSH_CACHE_DIR/completions/_hasura" ]]; then + hasura completion zsh --file "$ZSH_CACHE_DIR/completions/_hasura" >/dev/null + source "$ZSH_CACHE_DIR/completions/_hasura" +else + source "$ZSH_CACHE_DIR/completions/_hasura" + hasura completion zsh --file "$ZSH_CACHE_DIR/completions/_hasura" >/dev/null &| +fi |