#!/usr/bin/env bash # Rustup is available in debian and will install the latest rustc and cargo DEST=${1:-/etc/skel} RUSTUP_HOME=${DEST}/.rustup CARGO_HOME=${DEST}/.cargo sudo apt install rustup lldb # cargo-debstatus if [[ -d ${RUSTUP_HOME} ]]; then mv ${RUSTUP_HOME} ${RUSTUP_HOME}-backup fi if [[ -d ${CARGO_HOME} ]]; then mv ${CARGO_HOME} ${CARGO_HOME}-backup fi mkdir -p ${DEST}/.cargo ${DEST}/.rustup # sudo chown -R $(whoami) ${DEST}/.cargo ${DEST}/.rustup # RUSTC_BOOTSTRAP = "1" allows nightly features; use cautiously. conf_print_cargo_config() { cat <