-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.rust
executable file
·49 lines (37 loc) · 1.19 KB
/
install.rust
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
42
43
44
45
46
47
48
49
#!/bin/zsh
# NOTE: This script is normally source'd from `install`, but it can also be
# source'd from the command-line.
# Get some commands: is_being_sourced, source_rust_env
source "${DOTFILES}/zshenv"
source "${DOTFILES}/bin/shell_functions.zsh"
if is_being_sourced
then
if is_executable rustup
then
echo
echo "### Updating rust"
echo
rustup update
else
echo
echo "### Installing rust"
echo
# This method of installation -- where parameters are passed to the
# script -- is demonstrated in:
#
# https://github.com/rust-lang/rustup/doc/user-guide/src/installation/other.md
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --no-modify-path -y -q
# Set $PATH so that we can call `rustup`.
source_rust_env
# Some tools to consider (check out crates.io):
#
# cargo-watch # Watches for changed source files and re-run tests
rustup component add \
rust-analyzer \
llvm-tools \
rust-src
fi
else
echo "*** install.rust should be source'd in order for \$PATH changes to take effect"
fi
true