Add a command to list the plugins already installed

This commit is contained in:
Kevin Disneur 2015-06-14 13:27:32 +01:00
parent 9348661916
commit c2fc8dd34e
No known key found for this signature in database
GPG Key ID: 6D50AEFB5386EAB3
4 changed files with 23 additions and 0 deletions

View File

@ -54,6 +54,13 @@ asdf plugin-add <name> <git-url>
# asdf plugin-add erlang https://github.com/HashNuke/asdf-erlang.git
```
##### List installed plugins
```bash
asdf plugin-list
# asdf plugin-list
```
##### Remove a plugin
```bash

View File

@ -11,6 +11,7 @@ source $(dirname $(dirname $0))/lib/commands/list.sh
source $(dirname $(dirname $0))/lib/commands/list-all.sh
source $(dirname $(dirname $0))/lib/commands/reshim.sh
source $(dirname $(dirname $0))/lib/commands/plugin-add.sh
source $(dirname $(dirname $0))/lib/commands/plugin-list.sh
source $(dirname $(dirname $0))/lib/commands/plugin-update.sh
source $(dirname $(dirname $0))/lib/commands/plugin-remove.sh
@ -54,6 +55,9 @@ case $1 in
"plugin-add")
plugin_add_command $callback_args;;
"plugin-list")
plugin_list_command $callback_args;;
"plugin-update")
plugin_update_command $callback_args;;

View File

@ -1,5 +1,6 @@
MANAGE PLUGINS
asdf plugin-add <name> <git-url> Add git repo as plugin
asdf plugin-list List installed plugin
asdf plugin-remove <name> Remove plugin and package versions
asdf plugin-update <name> Update plugin
asdf plugin-update --all Update all plugins

View File

@ -0,0 +1,11 @@
plugin_list_command() {
local plugins_path=$(get_plugin_path)
if ls $plugins_path &> /dev/null; then
for plugin_path in $plugins_path/* ; do
echo "* $(basename $plugin_path)"
done
else
echo 'Oohes nooes ~! No versions installed'
fi
}