refactor(plugins): remove old generated completion files

This removes .gitignore plugin files and adds a force-rm of the old completion file,
which ignores any errors if the file doesn't exist.
parent d2269180
if (( $+commands[rustup] && $+commands[cargo] )); then if (( $+commands[rustup] && $+commands[cargo] )); then
# remove old generated completion file
command rm -f "${0:A:h}/_cargo"
# generate new completion file
ver="$(cargo --version)" ver="$(cargo --version)"
ver_file="$ZSH_CACHE_DIR/cargo_version" ver_file="$ZSH_CACHE_DIR/cargo_version"
comp_file="$ZSH_CACHE_DIR/completions/_cargo" comp_file="$ZSH_CACHE_DIR/completions/_cargo"
......
...@@ -12,6 +12,9 @@ alias dup='deno upgrade' ...@@ -12,6 +12,9 @@ alias dup='deno upgrade'
# COMPLETION FUNCTION # COMPLETION FUNCTION
if (( $+commands[deno] )); then if (( $+commands[deno] )); then
# remove old generated completion file
command rm -f "${0:A:h}/_deno"
ver="$(deno --version)" ver="$(deno --version)"
ver_file="$ZSH_CACHE_DIR/deno_version" ver_file="$ZSH_CACHE_DIR/deno_version"
comp_file="$ZSH_CACHE_DIR/completions/_deno" comp_file="$ZSH_CACHE_DIR/completions/_deno"
......
if (( $+commands[fnm] )); then if (( $+commands[fnm] )); then
# remove old generated completion file
command rm -f "${0:A:h}/_fnm"
ver="$(fnm --version)" ver="$(fnm --version)"
ver_file="$ZSH_CACHE_DIR/fnm_version" ver_file="$ZSH_CACHE_DIR/fnm_version"
comp_file="$ZSH_CACHE_DIR/completions/_fnm" comp_file="$ZSH_CACHE_DIR/completions/_fnm"
......
# Autocompletion for the GitHub CLI (gh). # Autocompletion for the GitHub CLI (gh).
if (( $+commands[gh] )); then if (( $+commands[gh] )); then
# remove old generated completion file
command rm -f "${0:A:h}/_gh"
ver="$(gh --version)" ver="$(gh --version)"
ver_file="$ZSH_CACHE_DIR/gh_version" ver_file="$ZSH_CACHE_DIR/gh_version"
comp_file="$ZSH_CACHE_DIR/completions/_gh" comp_file="$ZSH_CACHE_DIR/completions/_gh"
......
if (( $+commands[rustup] )); then if (( $+commands[rustup] )); then
# remove old generated completion file
command rm -f "${0:A:h}/_rustup"
ver="$(rustup --version 2>/dev/null)" ver="$(rustup --version 2>/dev/null)"
ver_file="$ZSH_CACHE_DIR/rustup_version" ver_file="$ZSH_CACHE_DIR/rustup_version"
comp_file="$ZSH_CACHE_DIR/completions/_rustup" comp_file="$ZSH_CACHE_DIR/completions/_rustup"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment