2019-11-27 01:24:29 -07:00
|
|
|
# -*- sh -*-
|
|
|
|
|
2015-05-17 00:46:56 -07:00
|
|
|
list_command() {
|
2015-05-26 23:46:17 -07:00
|
|
|
local plugin_name=$1
|
2015-05-07 22:58:07 -07:00
|
|
|
|
2018-04-16 15:37:22 -07:00
|
|
|
if [ -z "$plugin_name" ]; then
|
|
|
|
local plugins_path
|
|
|
|
plugins_path=$(get_plugin_path)
|
|
|
|
|
2019-11-29 09:15:38 -07:00
|
|
|
if ls "$plugins_path" &>/dev/null; then
|
|
|
|
for plugin_path in "$plugins_path"/*; do
|
2018-04-16 15:37:22 -07:00
|
|
|
plugin_name=$(basename "$plugin_path")
|
|
|
|
echo "$plugin_name"
|
|
|
|
display_installed_versions "$plugin_name"
|
|
|
|
done
|
|
|
|
else
|
|
|
|
printf "%s\\n" 'Oohes nooes ~! No plugins installed'
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
check_if_plugin_exists "$plugin_name"
|
|
|
|
display_installed_versions "$plugin_name"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
display_installed_versions() {
|
2017-09-04 10:04:56 -07:00
|
|
|
local versions
|
2018-04-16 15:37:22 -07:00
|
|
|
versions=$(list_installed_versions "$1")
|
2015-05-11 09:20:28 -07:00
|
|
|
|
2016-12-10 12:54:22 -07:00
|
|
|
if [ -n "${versions}" ]; then
|
|
|
|
for version in $versions; do
|
2018-05-31 09:45:20 -07:00
|
|
|
echo " $version"
|
2015-05-17 00:46:56 -07:00
|
|
|
done
|
|
|
|
else
|
2016-12-10 12:54:22 -07:00
|
|
|
display_error 'No versions installed'
|
2015-05-17 00:46:56 -07:00
|
|
|
fi
|
2018-06-16 12:04:38 -07:00
|
|
|
}
|
2019-11-27 01:24:29 -07:00
|
|
|
|
|
|
|
list_command "$@"
|