From 3fa90eef3b404b080e3fa3d03703e9732d7f757f Mon Sep 17 00:00:00 2001 From: Ismo Vuorinen Date: Sun, 15 Sep 2024 17:46:42 +0300 Subject: [PATCH] chore(bin): dfm, update install-* scripts --- .editorconfig | 2 +- local/bin/dfm | 2 +- scripts/install-asdf.sh | 16 ++++++++++++++-- scripts/install-cargo-packages.sh | 4 ++++ scripts/install-go-packages.sh | 4 ++++ scripts/install-npm-packages.sh | 4 ++++ scripts/install-pip-packages.sh | 4 ++++ 7 files changed, 32 insertions(+), 4 deletions(-) diff --git a/.editorconfig b/.editorconfig index e46e4a4..c99fecb 100644 --- a/.editorconfig +++ b/.editorconfig @@ -19,7 +19,7 @@ indent_size = 1 indent_size = 1 indent_style = tab -[{local/bin/*,**/*.sh,**/zshrc,config/*}] +[{local/bin/*,**/*.sh,**/zshrc,config/*,scripts/*}] shell_variant = bash # --language-variant binary_next_line = true switch_case_indent = true # --case-indent diff --git a/local/bin/dfm b/local/bin/dfm index 242712b..938c2a6 100755 --- a/local/bin/dfm +++ b/local/bin/dfm @@ -161,7 +161,7 @@ section_install() ;; asdf) msg "Installing asdf..." - bash "$DOTFILES/scripts/install-asdf.sh install" \ + bash "$DOTFILES/scripts/install-asdf.sh both" \ && msg_yay "asdf installed!" ;; cargo) diff --git a/scripts/install-asdf.sh b/scripts/install-asdf.sh index 3b6338f..3b62c7a 100755 --- a/scripts/install-asdf.sh +++ b/scripts/install-asdf.sh @@ -1,6 +1,13 @@ #!/usr/bin/env bash # -# Install asdf +# Install asdf and plugins I use +# +# It also updates asdf and the plugins, and then reshim asdf. +# +# Usage: ./install-asdf.sh [both|install|add_plugins] +# Author: Ismo Vuorinen +# License: MIT +# source "${DOTFILES}/config/shared.sh" export ASDF_DIR="${XDG_BIN_HOME}/asdf" @@ -80,13 +87,18 @@ reshim() # create usage function usage() { - echo "Usage: $0 [install|add_plugins]" + echo "Usage: $0 [both|install|add_plugins]" exit 1 } main() { case $1 in + "both") + install_asdf_plugins + update_asdf + reshim + ;; "install") update_asdf reshim diff --git a/scripts/install-cargo-packages.sh b/scripts/install-cargo-packages.sh index 99b0d43..f6d681b 100755 --- a/scripts/install-cargo-packages.sh +++ b/scripts/install-cargo-packages.sh @@ -2,6 +2,10 @@ # Install cargo/rust packages. # # shellcheck source=shared.sh + +echo "This file has been deprecated in favor of asdf. Please use asdf instead." +exit 0 + eval "$HOME/.dotfiles/config/shared.sh" msg "Starting to install rust/cargo packages" diff --git a/scripts/install-go-packages.sh b/scripts/install-go-packages.sh index 356e5c1..0ea23ca 100755 --- a/scripts/install-go-packages.sh +++ b/scripts/install-go-packages.sh @@ -2,6 +2,10 @@ # Install Go packages # # shellcheck source=shared.sh + +echo "This file has been deprecated in favor of asdf. Please use asdf instead." +exit 0 + eval "$DOTFILES/config/shared.sh" # Enable verbosity with VERBOSE=1 diff --git a/scripts/install-npm-packages.sh b/scripts/install-npm-packages.sh index afe4c16..adb7fac 100755 --- a/scripts/install-npm-packages.sh +++ b/scripts/install-npm-packages.sh @@ -2,6 +2,10 @@ # Install npm packages globally. # # shellcheck source=shared.sh + +echo "This file has been deprecated in favor of asdf. Please use asdf instead." +exit 0 + eval "$DOTFILES/config/shared.sh" # Enable verbosity with VERBOSE=1 diff --git a/scripts/install-pip-packages.sh b/scripts/install-pip-packages.sh index e7166f7..f4db468 100755 --- a/scripts/install-pip-packages.sh +++ b/scripts/install-pip-packages.sh @@ -2,6 +2,10 @@ # Install python/pip packages. # # shellcheck source=shared.sh + +echo "This file has been deprecated in favor of asdf. Please use asdf instead." +exit 0 + source "${DOTFILES}/config/shared.sh" # Enable verbosity with VERBOSE=1