2020-10-23 17:59:08 +03:00
|
|
|
#!/bin/bash -e -o pipefail
|
2023-11-28 02:25:03 +01:00
|
|
|
################################################################################
|
|
|
|
|
## File: install-rust.sh
|
|
|
|
|
## Desc: Install Rust
|
|
|
|
|
################################################################################
|
|
|
|
|
|
2020-12-28 10:54:25 +03:00
|
|
|
source ~/utils/utils.sh
|
2020-09-10 14:34:08 +03:00
|
|
|
|
2024-01-09 14:47:31 +01:00
|
|
|
echo "Installing Rustup..."
|
2020-12-28 10:54:25 +03:00
|
|
|
brew_smart_install "rustup-init"
|
2020-09-10 14:34:08 +03:00
|
|
|
|
2024-01-09 14:47:31 +01:00
|
|
|
echo "Installing Rust language..."
|
2020-09-10 14:34:08 +03:00
|
|
|
rustup-init -y --no-modify-path --default-toolchain=stable --profile=minimal
|
|
|
|
|
|
2024-01-09 14:47:31 +01:00
|
|
|
echo "Initialize environment variables..."
|
2020-09-10 14:34:08 +03:00
|
|
|
CARGO_HOME=$HOME/.cargo
|
|
|
|
|
|
2024-01-09 14:47:31 +01:00
|
|
|
echo "Install common tools..."
|
2020-11-02 16:17:58 +01:00
|
|
|
rustup component add rustfmt clippy
|
2023-11-10 18:05:14 +01:00
|
|
|
|
2024-08-09 11:25:15 +02:00
|
|
|
if is_Monterey; then
|
2024-08-08 11:24:37 +02:00
|
|
|
cargo install bindgen-cli cbindgen cargo-audit cargo-outdated
|
2023-11-10 18:05:14 +01:00
|
|
|
fi
|
2020-09-10 14:34:08 +03:00
|
|
|
|
2024-01-09 14:47:31 +01:00
|
|
|
echo "Cleanup Cargo registry cached data..."
|
2020-11-02 16:17:58 +01:00
|
|
|
rm -rf $CARGO_HOME/registry/*
|
2021-01-20 14:11:00 +07:00
|
|
|
|
|
|
|
|
invoke_tests "Rust"
|