2023-08-30 10:54:12 -06:00
|
|
|
#!/bin/sh
|
|
|
|
# SPDX-License-Identifier: GPL-3.0-only
|
|
|
|
|
|
|
|
# Install Rust via rustup, along with the pinned toolchain.
|
|
|
|
|
|
|
|
# shellcheck shell=dash
|
|
|
|
# shellcheck disable=SC1091
|
|
|
|
|
|
|
|
set -Ee
|
|
|
|
|
2024-03-05 09:33:50 -07:00
|
|
|
if ! command -v rustup >/dev/null 2>&1; then
|
2025-02-27 10:17:19 -07:00
|
|
|
if command -v rustup-init >/dev/null 2>&1; then
|
|
|
|
rustup-init -y \
|
|
|
|
--default-toolchain stable \
|
|
|
|
--profile minimal \
|
|
|
|
--no-update-default-toolchain
|
|
|
|
else
|
|
|
|
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \
|
|
|
|
| sh -s -- -y --default-toolchain stable
|
|
|
|
fi
|
2023-08-30 10:54:12 -06:00
|
|
|
|
|
|
|
. "${HOME}/.cargo/env"
|
|
|
|
fi
|
|
|
|
|
2025-02-28 09:17:26 -07:00
|
|
|
rustup show active-toolchain || rustup toolchain install
|