Do not run expensive env initializations for non-interactive shells

This commit is contained in:
Alexander Gehrke 2025-03-04 14:59:59 +01:00 committed by Alexander Roso
parent 87ced67ef2
commit 03e0518f6f
4 changed files with 13 additions and 1 deletions

2
env/50_rust.zsh vendored
View file

@ -1,6 +1,6 @@
export RUSTUP_HOME="${XDG_DATA_HOME}/rustup"
export CARGO_HOME="${XDG_DATA_HOME}/cargo"
export PATH="${CARGO_HOME}/bin:${PATH}"
if which rustup &>/dev/null && [[ -n $(rustup show active-toolchain) ]]; then
if [[ $- == *i* ]] && which rustup &>/dev/null && [[ -n $(rustup show active-toolchain) ]]; then
export RUST_SRC_PATH=$(rustup run stable rustc --print sysroot)/lib/rustlib/src/rust/src
fi