Bootstrap Rust in Unix installer
This commit is contained in:
+12
-1
@@ -92,7 +92,18 @@ need() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
need cargo
|
ensure_cargo() {
|
||||||
|
if command -v cargo >/dev/null 2>&1; then
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
need curl
|
||||||
|
echo "cargo not found; installing Rust toolchain with rustup" >&2
|
||||||
|
curl --proto '=https' --tlsv1.2 -fsSL https://sh.rustup.rs | sh -s -- -y
|
||||||
|
# shellcheck disable=SC1091
|
||||||
|
. "$HOME/.cargo/env"
|
||||||
|
}
|
||||||
|
|
||||||
|
ensure_cargo
|
||||||
|
|
||||||
cleanup() {
|
cleanup() {
|
||||||
if [ -n "${tmpdir:-}" ]; then
|
if [ -n "${tmpdir:-}" ]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user