asdf/lib/commands/list.sh

17 lines
459 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-29 09:20:32 -07:00
if [ -d $plugin_installs_path ]; then
2015-05-17 00:46:56 -07:00
#TODO check if dir is empty and show no-installed-versions msg
2015-05-29 09:20:32 -07:00
for install in ${plugin_installs_path}/*/; do
2015-05-17 00:46:56 -07:00
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
}