From fc16b8231ecd10dff1e90868888a1751d0185946 Mon Sep 17 00:00:00 2001 From: Ismo Vuorinen Date: Tue, 16 Jul 2024 22:58:29 +0300 Subject: [PATCH] feat!: asdf is now a git submodule --- .gitmodules | 3 +++ add-submodules.sh | 2 ++ base/bashrc | 4 ++-- config/exports-apps | 2 +- local/bin/asdf | 1 + scripts/install-asdf.sh | 18 +++--------------- 6 files changed, 12 insertions(+), 18 deletions(-) create mode 160000 local/bin/asdf diff --git a/.gitmodules b/.gitmodules index 00912c7..3508c6a 100644 --- a/.gitmodules +++ b/.gitmodules @@ -64,3 +64,6 @@ [submodule "tmux/tmux-dark-notify"] path = config/tmux/plugins/tmux-dark-notify url = https://github.com/erikw/tmux-dark-notify.git +[submodule "asdf"] + path = local/bin/asdf + url = https://github.com/asdf-vm/asdf.git diff --git a/add-submodules.sh b/add-submodules.sh index 50ee98b..c49bb71 100755 --- a/add-submodules.sh +++ b/add-submodules.sh @@ -18,6 +18,8 @@ git submodule add --name cheat-community \ -f https://github.com/cheat/cheatsheets.git config/cheat/cheatsheets/community git submodule add --name cheat-tldr \ -f https://github.com/ivuorinen/cheatsheet-tldr.git config/cheat/cheatsheets/tldr +git submodule add --name asdf \ + -f https://github.com/asdf-vm/asdf.git local/bin/asdf # tmux plugin manager and plugins git submodule add --name tmux/tmux-continuum \ diff --git a/base/bashrc b/base/bashrc index 6c9c734..4941727 100644 --- a/base/bashrc +++ b/base/bashrc @@ -16,8 +16,8 @@ x-have oh-my-posh && { eval "$(oh-my-posh init bash --config "$DOTFILES/config/omp/own.toml")" } -. "$HOME/.local/share/asdf/asdf.sh" -. "$HOME/.local/share/asdf/completions/asdf.bash" +. "$XDG_BIN_HOME/asdf/asdf.sh" +. "$XDG_BIN_HOME/asdf/completions/asdf.bash" x-have antidot && { eval "$(antidot init)" diff --git a/config/exports-apps b/config/exports-apps index 993bdae..a482c96 100755 --- a/config/exports-apps +++ b/config/exports-apps @@ -23,7 +23,7 @@ export ANDROID_HOME="$XDG_DATA_HOME/android" # asdf # https://github.com/asdf-vm/asdf -export ASDF_DIR="${XDG_DATA_HOME}/asdf" +export ASDF_DIR="${XDG_BIN_HOME}/asdf" export ASDF_CONFIG_FILE="${XDG_CONFIG_HOME}/asdf/asdfrc" export ASDF_DATA_DIR="${ASDF_DIR}" # This seems wrong, but `asdf info` and `versions.bash` differ on path resolution. diff --git a/local/bin/asdf b/local/bin/asdf new file mode 160000 index 0000000..ccdd47d --- /dev/null +++ b/local/bin/asdf @@ -0,0 +1 @@ +Subproject commit ccdd47df9b73d0a22235eb06ad4c48eb57360832 diff --git a/scripts/install-asdf.sh b/scripts/install-asdf.sh index 5226112..c5f650c 100755 --- a/scripts/install-asdf.sh +++ b/scripts/install-asdf.sh @@ -5,23 +5,11 @@ source "${XDG_CONFIG_HOME}/shared" source "${DOTFILES}/scripts/shared.sh" -# Installation variables -ASDF_GIT="https://github.com/asdf-vm/asdf.git" -ASDF_PATH="${XDG_DATA_HOME}/asdf" - -if [ ! -d "$ASDF_PATH" ]; then - git clone --depth 1 "$ASDF_GIT" "$ASDF_PATH" \ - --branch v0.14.0 - - msg_done "asdf ($ASDF_PATH/) installed" -else - msg_done "asdf ($ASDF_PATH/) already installed" -fi - -export PATH="${ASDF_PATH}/bin:$PATH" +export ASDF_DIR="${XDG_BIN_HOME}/asdf" +export PATH="${ASDF_DIR}/bin:$PATH" msg "Sourcing asdf in your shell" -. "$ASDF_PATH/asdf.sh" +. "$ASDF_DIR/asdf.sh" # Update asdf, and plugins asdf update