asdf/lib/asdf.sh
Trevor Brown 39909e01af
fix: add asdf to list of banned commands (#1224)
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.
2022-05-06 09:21:06 -04:00

21 lines
415 B
Bash

# The asdf function is a wrapper so we can export variables
asdf() {
local command
command="$1"
if [ "$#" -gt 0 ]; then
shift
fi
case "$command" in
"shell")
# commands that need to export variables
eval "$(asdf export-shell-version sh "$@")" # asdf_allow: eval
;;
*)
# forward other commands to asdf script
command asdf "$command" "$@" # asdf_allow: ' asdf '
;;
esac
}