this commit adds a lot of shit, look at the shit, too much sorry
Signed-off-by: Menno van Leeuwen <menno@vleeuwen.me>
This commit is contained in:
27
bin/helpers/rust.sh
Executable file
27
bin/helpers/rust.sh
Executable file
@ -0,0 +1,27 @@
|
||||
#!/usr/bin/env zsh
|
||||
|
||||
source ~/dotfiles/bin/helpers/functions.sh
|
||||
|
||||
ensure_rust_installed() {
|
||||
if [ -x "$(command -v rustc)" ]; then
|
||||
printfe "%s\n" "green" " - Rust is already installed"
|
||||
|
||||
# Update Rust
|
||||
printfe "%s" "yellow" " - Updating Rust..."
|
||||
echo -en "\r"
|
||||
|
||||
rustup update
|
||||
else
|
||||
printfe "%s\n" "yellow" " - Installing Rust..."
|
||||
echo -en "\r"
|
||||
|
||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
||||
|
||||
if [ $? -ne 0 ]; then
|
||||
printfe "%s\n" "red" "Failed to install Rust"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
printfe "%s\n" "green" " - Rust installed successfully"
|
||||
fi
|
||||
}
|
Reference in New Issue
Block a user