2014-08-05 12:45:59 -04:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
# when invoked with `prefix + U` this script:
|
|
|
|
# - shows a list of installed plugins
|
|
|
|
# - starts a prompt to enter the name of the plugin that will be updated
|
|
|
|
|
|
|
|
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
|
|
|
|
|
|
|
source "$CURRENT_DIR/shared_functions.sh"
|
|
|
|
|
|
|
|
display_plugin_update_list() {
|
2015-05-27 16:17:13 -04:00
|
|
|
local plugins plugin; plugins="$(shared_get_tpm_plugins_list)"
|
2014-08-05 12:45:59 -04:00
|
|
|
echo_message "Installed plugins:"
|
|
|
|
echo_message ""
|
|
|
|
|
|
|
|
for plugin in $plugins; do
|
|
|
|
# displaying only installed plugins
|
|
|
|
if plugin_already_installed "$plugin"; then
|
2015-05-27 16:17:13 -04:00
|
|
|
local plugin_name; plugin_name="$(shared_plugin_name "$plugin")"
|
2014-08-05 13:02:42 -04:00
|
|
|
echo_message " $plugin_name"
|
2014-08-05 12:45:59 -04:00
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
echo_message ""
|
2014-08-05 14:57:08 -04:00
|
|
|
echo_message "Type plugin name to update it."
|
2014-08-05 12:45:59 -04:00
|
|
|
echo_message ""
|
2014-08-05 14:57:08 -04:00
|
|
|
echo_message "- \"all\" - updates all plugins"
|
|
|
|
echo_message "- ENTER - cancels"
|
2014-08-05 12:45:59 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
update_plugin_prompt() {
|
|
|
|
tmux command-prompt -p 'plugin update:' " \
|
2015-04-05 18:09:00 -04:00
|
|
|
send-keys C-c; \
|
2014-08-05 12:45:59 -04:00
|
|
|
run-shell '$CURRENT_DIR/update_plugin.sh %1'"
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
main() {
|
|
|
|
reload_tmux_environment
|
|
|
|
shared_set_tpm_path_constant
|
|
|
|
display_plugin_update_list
|
|
|
|
update_plugin_prompt
|
|
|
|
}
|
|
|
|
main
|