Skip to content

Commit

Permalink
update: unset_all is now on the top
Browse files Browse the repository at this point in the history
  • Loading branch information
edvardsanta committed Sep 12, 2023
1 parent 06cad94 commit d55b53a
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions lib/commands/command-export-shell-version.bash
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,8 @@ unset_all() {
shell_command() {
local asdf_shell="$1"
shift

if [ "$#" -lt "2" ] && [ "$1" != "--unset-all" ]; then
printf "Usage: asdf shell {<name> {<version>|--unset}|--unset-all}\n" >&2
printf "false\n"
exit 1
fi

local plugin=$1
local version=$2

if [ "$plugin" = "--unset-all" ]; then

if [ "$1" = '--unset-all' ]; then
case "$asdf_shell" in
fish)
unset_all_fish
Expand All @@ -43,10 +34,18 @@ shell_command() {
unset_all
;;
esac

exit 0
fi


if [ "$#" -lt "2" ]; then
printf "Usage: asdf shell {<name> {<version>|--unset}|--unset-all}\n" >&2
printf "false\n"
exit 1
fi

local plugin=$1
local version=$2
local upcase_name
upcase_name=$(tr '[:lower:]-' '[:upper:]_' <<<"$plugin")
local version_env_var="ASDF_${upcase_name}_VERSION"
Expand Down

0 comments on commit d55b53a

Please sign in to comment.