mirror of
https://github.com/ivuorinen/dotfiles.git
synced 2026-02-15 20:53:44 +00:00
feat(dfm): add asdf helpers
This commit is contained in:
@@ -392,6 +392,51 @@ section_brew()
|
|||||||
! x-have brew && menu_section "$USAGE_PREFIX" "brew not available on this system"
|
! x-have brew && menu_section "$USAGE_PREFIX" "brew not available on this system"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
section_asdf()
|
||||||
|
{
|
||||||
|
USAGE_PREFIX="$SCRIPT asdf <command>"
|
||||||
|
MENU=(
|
||||||
|
"install:Install asdf"
|
||||||
|
"current:Show asdf current versions"
|
||||||
|
"global:Show asdf global versions"
|
||||||
|
"installed:Show asdf installed versions"
|
||||||
|
"local:Show asdf local versions"
|
||||||
|
"versions:Show asdf versions"
|
||||||
|
"where:Show asdf where"
|
||||||
|
"which:Show asdf which"
|
||||||
|
)
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
install)
|
||||||
|
msg "Installing asdf..."
|
||||||
|
bash "$DOTFILES/scripts/install-asdf.sh both" \
|
||||||
|
&& msg_yay "asdf installed!"
|
||||||
|
;;
|
||||||
|
current)
|
||||||
|
asdf current
|
||||||
|
;;
|
||||||
|
global)
|
||||||
|
asdf global
|
||||||
|
;;
|
||||||
|
installed)
|
||||||
|
asdf list
|
||||||
|
;;
|
||||||
|
local)
|
||||||
|
asdf local
|
||||||
|
;;
|
||||||
|
versions)
|
||||||
|
asdf list all
|
||||||
|
;;
|
||||||
|
where)
|
||||||
|
asdf where
|
||||||
|
;;
|
||||||
|
which)
|
||||||
|
asdf which
|
||||||
|
;;
|
||||||
|
*) menu_usage "$USAGE_PREFIX" "${MENU[@]}" ;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
section_helpers()
|
section_helpers()
|
||||||
{
|
{
|
||||||
USAGE_PREFIX="$SCRIPT helpers <command>"
|
USAGE_PREFIX="$SCRIPT helpers <command>"
|
||||||
@@ -605,6 +650,8 @@ usage()
|
|||||||
echo ""
|
echo ""
|
||||||
section_install
|
section_install
|
||||||
echo ""
|
echo ""
|
||||||
|
section_asdf
|
||||||
|
echo ""
|
||||||
section_brew
|
section_brew
|
||||||
echo ""
|
echo ""
|
||||||
section_check
|
section_check
|
||||||
@@ -623,6 +670,7 @@ main()
|
|||||||
# The main loop. The first keyword after $0 triggers section, or help.
|
# The main loop. The first keyword after $0 triggers section, or help.
|
||||||
case "$SECTION" in
|
case "$SECTION" in
|
||||||
install) section_install "$@" ;;
|
install) section_install "$@" ;;
|
||||||
|
asdf) section_asdf "$@" ;;
|
||||||
brew) section_brew "$@" ;;
|
brew) section_brew "$@" ;;
|
||||||
check) section_check "$@" ;;
|
check) section_check "$@" ;;
|
||||||
dotfiles) section_dotfiles "$@" ;;
|
dotfiles) section_dotfiles "$@" ;;
|
||||||
|
|||||||
Reference in New Issue
Block a user