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

View file

@ -44,7 +44,7 @@ path=(~/bin ~/.local/bin "${path[@]}")
fpath=("$DOTFILES_PATH/completions" "${fpath[@]}") fpath=("$DOTFILES_PATH/completions" "${fpath[@]}")
# check for Rust installed via rustup # 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 # add paths to the current Rust toolchain
path=(~/.cargo/bin "${path[@]}") path=(~/.cargo/bin "${path[@]}")
fpath=("$rust_sysroot/share/zsh/site-functions" "${fpath[@]}") fpath=("$rust_sysroot/share/zsh/site-functions" "${fpath[@]}")