mirror of
https://github.com/asdf-vm/asdf.git
synced 2024-11-15 01:28:17 -07:00
21 lines
453 B
Bash
21 lines
453 B
Bash
# shellcheck shell=sh
|
|
|
|
# The asdf function is a wrapper so we can export variables
|
|
asdf() {
|
|
case $1 in
|
|
"shell")
|
|
if ! shift; then
|
|
printf '%s\n' 'asdf: Error: Failed to shift' >&2
|
|
return 1
|
|
fi
|
|
|
|
# Invoke command that needs to export variables.
|
|
eval "$(asdf export-shell-version sh "$@")" # asdf_allow: eval
|
|
;;
|
|
*)
|
|
# Forward other commands to asdf script.
|
|
command asdf "$@" # asdf_allow: ' asdf '
|
|
;;
|
|
esac
|
|
}
|