fix "file not found" errors when Rust is not installed

This commit is contained in:
Dmytro Meleshko 2018-12-02 12:06:15 +02:00
parent e740e1aa40
commit ed96623fb6
1 changed files with 1 additions and 1 deletions

View File

@ -44,7 +44,7 @@ path=(~/bin ~/.local/bin "${path[@]}")
fpath=("$DOTFILES_PATH/completions" "${fpath[@]}")
# check for Rust installed via rustup
if rust_sysroot="$(~/.cargo/bin/rustc --print sysroot)"; then
if rust_sysroot="$(~/.cargo/bin/rustc --print sysroot 2> /dev/null)"; then
# add paths to the current Rust toolchain
path=(~/.cargo/bin "${path[@]}")
fpath=("$rust_sysroot/share/zsh/site-functions" "${fpath[@]}")