diff --git a/lib/asdf.sh b/lib/asdf.sh index 7ad83741..f43aae58 100644 --- a/lib/asdf.sh +++ b/lib/asdf.sh @@ -13,7 +13,7 @@ asdf() { ;; *) # forward other commands to asdf script - command asdf "$command" "$@" + command asdf "$command" "$@" # asdf_allow: ' asdf ' ;; esac diff --git a/lib/commands/reshim.bash b/lib/commands/reshim.bash index be6fd655..0c0fb52a 100644 --- a/lib/commands/reshim.bash +++ b/lib/commands/reshim.bash @@ -97,7 +97,7 @@ write_shim_script() { cat <"$shim_path" #!/usr/bin/env bash # asdf-plugin: ${plugin_name} ${version} -exec $(asdf_dir)/bin/asdf exec "${executable_name}" "\$@" +exec $(asdf_dir)/bin/asdf exec "${executable_name}" "\$@" # asdf_allow: ' asdf ' EOF fi diff --git a/test/banned_commands.bats b/test/banned_commands.bats index 360354af..d2a81f86 100644 --- a/test/banned_commands.bats +++ b/test/banned_commands.bats @@ -41,6 +41,12 @@ banned_commands_regex=( # match certain filename patterns. # https://github-wiki-see.page/m/koalaman/shellcheck/wiki/SC2012 '\bls ' + + # Ban recusive asdf calls as they are inefficient and may introduce bugs. + # If you find yourself needing to invoke an `asdf` command from within + # asdf code, please source the appropriate file and invoke the + # corresponding function. + '\basdf ' ) setup() {