Overhaul install script

Signed-off-by: Severin Kaderli <severin@kaderli.dev>
This commit is contained in:
Severin Kaderli 2020-02-02 20:20:32 +01:00
parent ce2413484c
commit b2e45c8af1
Signed by: severinkaderli
GPG key ID: F419F8835B72F0C4
26 changed files with 692 additions and 407 deletions

31
.install/rust.sh Normal file
View file

@ -0,0 +1,31 @@
#!/usr/bin/env bash
#
# SCRIPT NAME:
# rust.sh
#
# AUTHOR:
# Severin Kaderli <severin@kaderli.dev>
#
# DESCRIPTION:
# Install a Rust toolchain and components using Rustup
CONFIG_RUST_CHANNEL="beta"
CONFIG_RUST_COMPONENTS=(
"clippy"
"rls"
"rustfmt"
)
output::section "Rust"
if output::prompt "Do you want to install a Rust toolchain?"; then
output::log "Installing Rust using ${CONFIG_RUST_CHANNEL} channel"
rustup -q toolchain install "${CONFIG_RUST_CHANNEL}" |& output::debug
rustup -q default "${CONFIG_RUST_CHANNEL}" |& output::debug
output::success "Rust toolchain was installed and activated"
output::log "Installing components for Rust"
output::list ${CONFIG_RUST_COMPONENTS[@]}
rustup -q component add "${CONFIG_RUST_COMPONENTS[@]}" |& output::debug
output::success "Rust components were successfully installed"
fi