Skip to content

Commit

Permalink
fix: ensure asdf-plugin-manager works in expected worktree (#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
airtonix authored Sep 23, 2024
1 parent 4be90c2 commit 309be80
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions cli/asdf-plugin-manager.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,17 @@ print_git_compare_url() {
local plugin_ref_current="$2"
local plugin_ref_head="$3"

if $(echo "${provider_url}" | grep -q 'github'); then
echo "${plugin_url%.*}/compare/${plugin_ref_current}...${plugin_ref_head}"
elif $(echo "${provider_url}" | grep -q 'gitlab'); then
echo "${plugin_url%.*}/-/compare/${plugin_ref_current}...${plugin_ref_head}"
fi
case "${provider_url}" in
*github*)
echo "${provider_url%.*}/compare/${plugin_ref_current}...${plugin_ref_head}"
;;
*gitlab*)
echo "${provider_url%.*}/-/compare/${plugin_ref_current}...${plugin_ref_head}"
;;
*)
echo "Unknown provider: ${provider_url}"
;;
esac
}

export_plugins() {
Expand All @@ -72,7 +78,11 @@ export_plugins() {
checkout_plugin_ref() {
plugin_name="${1}"
plugin_ref="${2}"
git --git-dir "${PLUGINS_REPOS_DIR}/${plugin_name}/.git" checkout "${plugin_ref}" -q
git_dir="${PLUGINS_REPOS_DIR}/${plugin_name}"

git --git-dir "${git_dir}/.git" \
--work-tree "${git_dir}" \
checkout "${plugin_ref}"
}

list_plugins() {
Expand Down

0 comments on commit 309be80

Please sign in to comment.