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:
2024-08-24 01:35:46 +02:00
parent 379b1b97ec
commit 183b688617
52 changed files with 580 additions and 453 deletions

27
bin/helpers/rust.sh Executable file
View 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
}