Skip to content

Commit

Permalink
fix: plugin extension commands to not require bin/ directory (#1643)
Browse files Browse the repository at this point in the history
  • Loading branch information
hyperupcall committed Sep 17, 2023
1 parent b45f1dc commit 61420ad
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions bin/asdf
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 61420ad

Please sign in to comment.