Skip to content

Instantly share code, notes, and snippets.

@iloveitaly
Last active October 29, 2024 11:58
Show Gist options
  • Save iloveitaly/357a72f0f9e70f3a7d2aa6f8c40cf956 to your computer and use it in GitHub Desktop.
Save iloveitaly/357a72f0f9e70f3a7d2aa6f8c40cf956 to your computer and use it in GitHub Desktop.
# make sure you execute this *after* asdf or other version managers are loaded
# bun completions are strange: running `bun completions` installs ~/.bun/_bun and does not output the completion source code
# this is a hack until bun fixes their completion setup https://github.com/oven-sh/bun/issues/1272
# this will mutate your zshrc: https://github.com/oven-sh/bun/issues/10897
plugin_dir="${0:A:h}"
cache_file="$plugin_dir/_bun"
if (( $+commands[bun] )); then
if [[ ! -f "$cache_file" || ! $(/usr/bin/find "$cache_file" -mtime -15 2>/dev/null) ]]; then
bun completions $plugin_dir
fi
# rg completion script cannot be executed directly
fpath+=$plugin_dir
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment