Skip to content

Instantly share code, notes, and snippets.

@iloveitaly
Last active October 28, 2024 22:45
Show Gist options
  • Save iloveitaly/bfca38b1ae8ff649f822cea704a49a5a to your computer and use it in GitHub Desktop.
Save iloveitaly/bfca38b1ae8ff649f822cea704a49a5a to your computer and use it in GitHub Desktop.
# NOTE if you have multiple uv versions installed, the completion used will be random
plugin_dir="${0:A:h}"
uv_cache_file="$plugin_dir/_uv"
uvx_cache_file="$plugin_dir/_uvx"
if (( $+commands[uv] )); then
if [[ ! -f "$uv_cache_file" || ! $(/usr/bin/find "$uv_cache_file" -mtime -15 2>/dev/null) ]]; then
uv generate-shell-completion zsh > "$uv_cache_file"
uvx --generate-shell-completion zsh > "$uvx_cache_file"
fi
fpath+="$plugin_dir"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment