1
0
Fork 0
mirror of synced 2024-12-13 19:05:45 -05:00
tpm/bindings/update_plugins

50 lines
1.2 KiB
Text
Raw Normal View History

#!/usr/bin/env bash
# Tmux key-binding script.
# Scripts intended to be used via the command line are in `bin/` directory.
# 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 )"
SCRIPTS_DIR="$CURRENT_DIR/../scripts"
2015-08-03 09:12:45 -04:00
HELPERS_DIR="$SCRIPTS_DIR/helpers"
source "$SCRIPTS_DIR/shared_functions.sh"
2015-08-03 09:12:45 -04:00
source "$HELPERS_DIR/tmux_echo_functions.sh"
source "$HELPERS_DIR/tmux_utils.sh"
display_plugin_update_list() {
local plugins="$(shared_get_tpm_plugins_list)"
2015-08-02 19:25:51 -04:00
tmux_echo "Installed plugins:"
tmux_echo ""
for plugin in $plugins; do
# displaying only installed plugins
if plugin_already_installed "$plugin"; then
2014-08-05 13:02:42 -04:00
local plugin_name="$(shared_plugin_name "$plugin")"
2015-08-02 19:25:51 -04:00
tmux_echo " $plugin_name"
fi
done
2015-08-02 19:25:51 -04:00
tmux_echo ""
tmux_echo "Type plugin name to update it."
tmux_echo ""
tmux_echo "- \"all\" - updates all plugins"
tmux_echo "- ENTER - cancels"
}
update_plugin_prompt() {
tmux command-prompt -p 'plugin update:' " \
2015-04-05 18:09:00 -04:00
send-keys C-c; \
run-shell '$SCRIPTS_DIR/update_plugin_prompt_handler.sh %1'"
}
main() {
reload_tmux_environment
display_plugin_update_list
update_plugin_prompt
}
main