asdf/lib/commands/plugin-remove.sh
Victor Borja d1f0b64c2f Remove shims on uninstall or plugin-remove
- Remove plugin shims when last version is uninstalled.
- Remove shims on plugin-remove

When the latest version of a tool is uninstalled,
Remove the plugin shims (marked with metadata at #122)

Also found lots of missing tests and added them.

Closes #67
2016-12-15 06:05:23 -06:00

12 lines
297 B
Bash

plugin_remove_command() {
local plugin_name=$1
check_if_plugin_exists $plugin_name
local plugin_path=$(get_plugin_path $plugin_name)
rm -rf $plugin_path
rm -rf $(asdf_dir)/installs/${plugin_name}
grep -l "asdf-plugin: ${plugin_name}" $(asdf_dir)/shims/* 2>/dev/null | xargs rm -f
}