mirror of
https://github.com/asdf-vm/asdf.git
synced 2024-11-15 01:28:17 -07:00
Add a command to list the plugins already installed
This commit is contained in:
parent
9348661916
commit
c2fc8dd34e
@ -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
|
||||
|
4
bin/asdf
4
bin/asdf
@ -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;;
|
||||
|
||||
|
1
help.txt
1
help.txt
@ -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
|
||||
|
11
lib/commands/plugin-list.sh
Normal file
11
lib/commands/plugin-list.sh
Normal 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
|
||||
}
|
Loading…
Reference in New Issue
Block a user