Last active
October 19, 2020 01:16
-
-
Save kazuakiishiguro/00a8fe4c6099dc01941d07ec5e83c8c6 to your computer and use it in GitHub Desktop.
rust install and update script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -eu | |
echo "Installing rust" | |
if !(type "cargo" > /dev/null 2>&1); then | |
curl https://sh.rustup.rs -sSf | sh | |
source ~/.bashrc | |
else | |
echo "Rust already installed" | |
fi | |
which rustc | |
rustc --version | |
echo "rustc settings" | |
rustup component add rust-src | |
rustup toolchain add nightly | |
echo "Installing cargo packages" | |
echo "cargo install crates....." | |
PACKAGES=(cargo-edit cargo-update cargo-watch racer) | |
for item in ${PACKAGES[@]}; do | |
if !(cargo install --list | grep $item > /dev/null); then | |
cargo install $item | |
fi | |
done | |
COMPONENTS=(rustfmt clippy) | |
for item in ${COMPONENTS[@]}; do | |
if !(rustup component list | grep $item > /dev/null); then | |
rustup component add $item | |
fi | |
done | |
echo "Install finished 🦀" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment