-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall-rust
More file actions
executable file
·41 lines (31 loc) · 996 Bytes
/
install-rust
File metadata and controls
executable file
·41 lines (31 loc) · 996 Bytes
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
35
36
37
38
39
40
41
#!/usr/bin/env bash
set -euo pipefail
if ! command -v rustc &>/dev/null; then
echo "Installing Rust.."
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | bash -s -- -y --no-modify-path
fi
export PATH="$HOME/.cargo/bin:$PATH"
rustup default stable
rustup component add rust-src rust-analyzer
rustup target add wasm32-unknown-unknown x86_64-pc-windows-gnu aarch64-apple-darwin
rustup toolchain install nightly
echo "Installing Rust programs"
mkdir -p ~/.cargo/tmp
trap 'rm -r ~/.cargo/tmp' EXIT
export CARGO_TARGET_DIR=~/.cargo/tmp
cargo_install() {
cargo install --locked "$@"
}
for proj in ~/.dotfiles/bin/rust/*; do
[[ "$proj" = *paths-to-tree* ]] && continue
[[ "$proj" = *spacer* ]] && continue
cargo_install --path $proj
done
if [[ $# == 1 && $1 == "--local" ]]; then
exit 0
fi
cargo_install cargo-nextest
cargo_install cargo-watch
cargo_install diskonaut
cargo_install atuin --version "$(~/.dotfiles/bin/dotfiles-version atuin)"
cargo_install --features cli dotenv