asdf/lib/commands/list.sh

17 lines
461 B
Bash
Raw Normal View History

2015-05-17 00:46:56 -07:00
list_command() {
local plugin_name=$1
local plugin_path=$(get_plugin_path $plugin_name)
2015-05-17 11:20:51 -07:00
check_if_plugin_exists $plugin_path
2015-05-07 22:58:07 -07:00
local plugin_installs_path=$(asdf_dir)/installs/${plugin_name}
2015-05-11 09:20:28 -07:00
2015-05-17 03:47:45 -07:00
if [ -d $package_installs_path ]; then
2015-05-17 00:46:56 -07:00
#TODO check if dir is empty and show no-installed-versions msg
for install in ${package_installs_path}/*/; do
echo "$(basename $install)"
done
else
2015-05-18 23:47:00 -07:00
echo 'Oohes nooes ~! No versions installed'
2015-05-17 00:46:56 -07:00
fi
}