#!/usr/bin/env bash DIR="$(realpath "$(dirname -- "$0")")" # set env variables to overwrite the directory where rust is installed into export RUSTUP_HOME="$DIR/.rustup" export CARGO_HOME="$DIR/.cargo" # download rust curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --no-modify-path # set the default rust version source "$DIR/.cargo/env" rustup default stable