dotfiles/bashrc.d/rust.bashrc

23 lines
508 B
Plaintext
Raw Permalink Normal View History

2024-09-14 17:05:53 -04:00
export RUSTUP_INIT_SKIP_PATH_CHECK=yes
# https://rustup.rs/
function install_rustup {
if command -v rustup &> /dev/null; then
echo "Rustup is already installed."
return 1
fi
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --no-modify-path
}
if [ -d "${HOME}/.cargo" ]; then
if [ -e "${HOME}/.cargo/env" ]; then
source "$HOME/.cargo/env"
fi
export CARGO_TARGET_DIR="$HOME/.cache/cargo-target"
if [ ! -e "${CARGO_TARGET_DIR}" ]; then
mkdir -p "$CARGO_TARGET_DIR"
fi
fi