-
Notifications
You must be signed in to change notification settings - Fork 3.1k
/
rust.sh
34 lines (25 loc) · 948 Bytes
/
rust.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/bash -e
################################################################################
## File: rust.sh
## Desc: Installs Rust
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/etc-environment.sh
source $HELPER_SCRIPTS/os.sh
export RUSTUP_HOME=/etc/skel/.rustup
export CARGO_HOME=/etc/skel/.cargo
curl -fsSL https://sh.rustup.rs | sh -s -- -y --default-toolchain=stable --profile=minimal
# Initialize environment variables
source $CARGO_HOME/env
# Install common tools
rustup component add rustfmt clippy
if isUbuntu22; then
cargo install bindgen-cli cbindgen cargo-audit cargo-outdated
else
cargo install --locked bindgen-cli cbindgen cargo-audit cargo-outdated
fi
# Cleanup Cargo cache
rm -rf ${CARGO_HOME}/registry/*
# Update /etc/environemnt
prependEtcEnvironmentPath '$HOME/.cargo/bin'
invoke_tests "Tools" "Rust"