Skip to content

Commit

Permalink
fix: Extension command plugins work without bin/ directory
Browse files Browse the repository at this point in the history
  • Loading branch information
hyperupcall committed Sep 17, 2023
1 parent b45f1dc commit 5fb247c
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions bin/asdf
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,13 @@ find_asdf_cmd() {

find_plugin_cmd() {
local ASDF_CMD_FILE args_offset
if [ -d "$(get_plugin_path "$1")/bin" ]; then
local result=
result="$(find_cmd "$(get_plugin_path "$1")/lib/commands" "${@:2}")"
ASDF_CMD_FILE=${result% *}
args_offset=${result##* }
if [ -n "$ASDF_CMD_FILE" ]; then
args_offset=$((args_offset + 1)) # since the first argument is the plugin name
printf "%s %s\n" "$ASDF_CMD_FILE" "$args_offset"
fi
local result=
result="$(find_cmd "$(get_plugin_path "$1")/lib/commands" "${@:2}")"
ASDF_CMD_FILE=${result% *}
args_offset=${result##* }
if [ -n "$ASDF_CMD_FILE" ]; then
args_offset=$((args_offset + 1)) # since the first argument is the plugin name
printf "%s %s\n" "$ASDF_CMD_FILE" "$args_offset"
fi
}

Expand Down

0 comments on commit 5fb247c

Please sign in to comment.