mirror of
https://github.com/keanuplayz/dotfiles.git
synced 2024-08-15 02:33:12 +00:00
[zsh] don't crash when rustup isn't installed
This commit is contained in:
parent
fdffee61c7
commit
2bf31fc1c0
1 changed files with 9 additions and 6 deletions
|
@ -14,13 +14,16 @@ _plugin completions-rustc 'https://raw.githubusercontent.com/rust-lang/zsh-confi
|
|||
_plugin completions-cargo 'https://raw.githubusercontent.com/rust-lang/cargo/master/src/etc/_cargo' from=url \
|
||||
after_load='plugin-cfg-path fpath prepend ""'
|
||||
|
||||
rustup_bin="${commands[rustup]}"
|
||||
if [[ -n "$rustup_bin" ]]; then
|
||||
rustup_comp_path="${ZSH_CACHE_DIR}/site-functions/_rustup"
|
||||
if [[ "${commands[rustup]}" -nt "$rustup_comp_path" || ! -s "$rustup_comp_path" ]]; then
|
||||
if [[ "$rustup_bin" -nt "$rustup_comp_path" || ! -s "$rustup_comp_path" ]]; then
|
||||
_perf_timer_start "generate rustup completions"
|
||||
rustup completions zsh >| "$rustup_comp_path"
|
||||
"$rustup_bin" completions zsh >| "$rustup_comp_path"
|
||||
_perf_timer_stop "generate rustup completions"
|
||||
fi
|
||||
unset rustup_comp_path
|
||||
fi
|
||||
|
||||
# compinit {{{
|
||||
_perf_timer_start "compinit"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue