asdf/lib/commands/plugin-update.sh

20 lines
493 B
Bash
Raw Normal View History

2015-05-17 11:20:51 -07:00
plugin_update_command() {
2016-07-03 04:15:57 -07:00
if [ "$#" -ne 1 ]; then
display_error "usage: asdf plugin-update {<name> | --all}"
exit 1
fi
2015-05-20 21:31:09 -07:00
local plugin_name=$1
if [ "$plugin_name" = "--all" ]; then
2015-05-17 11:32:57 -07:00
for dir in $(asdf_dir)/plugins/*; do
2015-05-20 21:31:09 -07:00
echo "Updating $(basename $dir)..."
2015-05-17 03:47:45 -07:00
(cd "$dir" && git pull)
done
2015-05-17 00:46:56 -07:00
else
2015-05-20 21:31:09 -07:00
local plugin_path=$(get_plugin_path $plugin_name)
check_if_plugin_exists $plugin_name
2015-05-20 21:31:09 -07:00
echo "Updating $plugin_name..."
2015-05-17 11:20:51 -07:00
(cd $plugin_path; git pull)
2015-05-17 00:46:56 -07:00
fi
}