#!/bin/sh SCRIPT_ROOT=$(cd -P -- "$(dirname -- "$0")" && pwd -P) cd "$SCRIPT_ROOT" # Init a fresh target folder on tmpfs TARGET_SRC="/tmp/cargo/$(basename "$SCRIPT_ROOT")/target" TARGET_DST="$SCRIPT_ROOT/target" rm -rf "$TARGET_DST" mkdir -p "$TARGET_SRC" ln -sf "$TARGET_SRC" "$TARGET_DST" # Update rustup rustup self update # Update Rust toolchain rustup update stable # Update crate dependencies cargo update