volta.plugin.zsh 662 B

12345678910111213141516171819
  1. # COMPLETION FUNCTION
  2. if (( ! $+commands[volta] )); then
  3. return
  4. fi
  5. # TODO: 2021-12-28: remove this bit of code as it exists in oh-my-zsh.sh
  6. # Add completions folder in $ZSH_CACHE_DIR
  7. command mkdir -p "$ZSH_CACHE_DIR/completions"
  8. (( ${fpath[(Ie)"$ZSH_CACHE_DIR/completions"]} )) || fpath=("$ZSH_CACHE_DIR/completions" $fpath)
  9. # If the completion file doesn't exist yet, we need to autoload it and
  10. # bind it to `deno`. Otherwise, compinit will have already done that.
  11. if [[ ! -f "$ZSH_CACHE_DIR/completions/_volta" ]]; then
  12. typeset -g -A _comps
  13. autoload -Uz _volta
  14. _comps[volta]=_volta
  15. fi
  16. volta completions zsh >| "$ZSH_CACHE_DIR/completions/_volta" &|