feat(dfm): install rust/cargo packages

This commit is contained in:
2023-09-19 02:22:05 +03:00
parent 00de4a7b83
commit a26f160326
2 changed files with 34 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
#!/usr/bin/env bash
# Install cargo/rust packages.
#
# shellcheck source=shared.sh
source "$HOME/.dotfiles/scripts/shared.sh"
! have cargo && {
msg "cargo could not be found. installing cargo with rustup.rs"
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
}
packages=(
# a subprocess caching utility
"bkt"
# a structural diff that understands syntax
"difftastic"
)
for pkg in "${packages[@]}"; do
# Trim spaces
pkg=${pkg// /}
# Skip comments
if [[ ${pkg:0:1} == "#" ]]; then continue; fi
cargo install $pkg
echo ""
done