mirror of https://github.com/tmux-plugins/tpm
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
48 lines
1.2 KiB
48 lines
1.2 KiB
9 years ago
|
#!/usr/bin/env bash
|
||
|
|
||
8 years ago
|
# Tmux key-binding script.
|
||
|
# Scripts intended to be used via the command line are in `bin/` directory.
|
||
|
|
||
|
# This script:
|
||
9 years ago
|
# - 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 )"
|
||
8 years ago
|
SCRIPTS_DIR="$CURRENT_DIR/../scripts"
|
||
9 years ago
|
|
||
8 years ago
|
source "$SCRIPTS_DIR/shared_functions.sh"
|
||
9 years ago
|
|
||
|
display_plugin_update_list() {
|
||
|
local plugins="$(shared_get_tpm_plugins_list)"
|
||
|
echo_message "Installed plugins:"
|
||
|
echo_message ""
|
||
|
|
||
|
for plugin in $plugins; do
|
||
|
# displaying only installed plugins
|
||
|
if plugin_already_installed "$plugin"; then
|
||
9 years ago
|
local plugin_name="$(shared_plugin_name "$plugin")"
|
||
|
echo_message " $plugin_name"
|
||
9 years ago
|
fi
|
||
|
done
|
||
|
|
||
|
echo_message ""
|
||
9 years ago
|
echo_message "Type plugin name to update it."
|
||
9 years ago
|
echo_message ""
|
||
9 years ago
|
echo_message "- \"all\" - updates all plugins"
|
||
|
echo_message "- ENTER - cancels"
|
||
9 years ago
|
}
|
||
|
|
||
|
update_plugin_prompt() {
|
||
|
tmux command-prompt -p 'plugin update:' " \
|
||
8 years ago
|
send-keys C-c; \
|
||
8 years ago
|
run-shell '$SCRIPTS_DIR/update_plugin_prompt_handler.sh %1'"
|
||
9 years ago
|
}
|
||
|
|
||
|
main() {
|
||
|
reload_tmux_environment
|
||
|
shared_set_tpm_path_constant
|
||
|
display_plugin_update_list
|
||
|
update_plugin_prompt
|
||
|
}
|
||
|
main
|