2021-09-07 20:02:20 +02:00
|
|
|
if (( $+commands[rustup] )); then
|
2021-09-15 18:18:25 +02:00
|
|
|
ver="$(rustup --version 2>/dev/null)"
|
|
|
|
ver_file="$ZSH_CACHE_DIR/rustup_version"
|
|
|
|
comp_file="$ZSH/plugins/rustup/_rustup"
|
|
|
|
|
|
|
|
if [[ ! -f "$comp_file" || ! -f "$ver_file" || "$ver" != "$(< "$ver_file")" ]]; then
|
|
|
|
rustup completions zsh >| "$comp_file"
|
|
|
|
echo "$ver" >| "$ver_file"
|
2021-09-07 20:02:20 +02:00
|
|
|
fi
|
2021-09-15 18:18:25 +02:00
|
|
|
|
|
|
|
declare -A _comps
|
2021-09-07 20:02:20 +02:00
|
|
|
autoload -Uz _rustup
|
|
|
|
_comps[rustup]=_rustup
|
2021-09-15 18:18:25 +02:00
|
|
|
|
|
|
|
unset ver ver_file comp_file
|
2021-09-07 20:02:20 +02:00
|
|
|
fi
|