asdf/lib/commands/plugin-update.sh

15 lines
387 B
Bash
Raw Normal View History

2015-05-17 11:20:51 -07:00
plugin_update_command() {
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)
2015-05-17 11:20:51 -07:00
check_if_plugin_exists $plugin_path
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
}