asdf/lib/commands/current.sh
Kevin Rockwood 4d75ddd50b Update current command with new util functions
current will now print paths to legacy files and .tool-version files
2016-08-14 09:10:24 +09:00

16 lines
410 B
Bash

current_command() {
local plugin_name=$1
check_if_plugin_exists $plugin_name
local version_file_path=$(find_version_file_for $plugin_name)
local version=$(parse_version_file $version_file_path $plugin_name)
check_if_version_exists $plugin_name $version
if [ -z "$version" ]; then
echo "No version set for $plugin_name"
exit 1
else
echo "$version (set by $version_file_path)"
fi
}