mirror of
https://github.com/ivuorinen/dotfiles.git
synced 2026-03-21 23:07:25 +00:00
feat(dfm): install rust/cargo packages
This commit is contained in:
@@ -28,6 +28,7 @@ function section_install
|
|||||||
MENU=(
|
MENU=(
|
||||||
"all:Installs everything in the correct order"
|
"all:Installs everything in the correct order"
|
||||||
"antigen:Updates the antigen.zsh file"
|
"antigen:Updates the antigen.zsh file"
|
||||||
|
"cargo:Install rust/cargo packages"
|
||||||
"cheat-databases:Install cheat external cheatsheet databases"
|
"cheat-databases:Install cheat external cheatsheet databases"
|
||||||
"composer:Install composer"
|
"composer:Install composer"
|
||||||
"dotenv:Install dotenv-linter"
|
"dotenv:Install dotenv-linter"
|
||||||
@@ -48,6 +49,7 @@ function section_install
|
|||||||
$0 install macos
|
$0 install macos
|
||||||
$0 install antigen
|
$0 install antigen
|
||||||
$0 brew install
|
$0 brew install
|
||||||
|
$0 install cargo
|
||||||
$0 install composer
|
$0 install composer
|
||||||
$0 install dotenv
|
$0 install dotenv
|
||||||
$0 install fzf
|
$0 install fzf
|
||||||
@@ -65,6 +67,10 @@ function section_install
|
|||||||
curl -sSfL git.io/antigen -o "$DOTFILES/local/bin/antigen.zsh" \
|
curl -sSfL git.io/antigen -o "$DOTFILES/local/bin/antigen.zsh" \
|
||||||
&& msg_yay "New antigen installed!"
|
&& msg_yay "New antigen installed!"
|
||||||
;;
|
;;
|
||||||
|
cargo)
|
||||||
|
bash "$DOTFILES/scripts/install-cargo-packages.sh" \
|
||||||
|
&& msg_yay "cargo packages installed!"
|
||||||
|
;;
|
||||||
cheat-databases)
|
cheat-databases)
|
||||||
for database in "$DOTFILES"/scripts/install-cheat-*; do
|
for database in "$DOTFILES"/scripts/install-cheat-*; do
|
||||||
bash "$database" \
|
bash "$database" \
|
||||||
|
|||||||
28
scripts/install-cargo-packages.sh
Executable file
28
scripts/install-cargo-packages.sh
Executable 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
|
||||||
Reference in New Issue
Block a user