1
0
Fork 0
mirror of synced 2024-11-16 06:25:36 -05:00
This commit is contained in:
Jason Gomez 2023-07-03 13:32:00 +01:00 committed by GitHub
commit 3863e97cdf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 3 deletions

View file

@ -7,6 +7,11 @@
# - shows a list of installed plugins
# - starts a prompt to enter the name of the plugin that will be updated
if command -v tput >/dev/null; then
yellow=$(tput setaf 3)
norm=$(tput sgr0)
fi
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
SCRIPTS_DIR="$CURRENT_DIR/../scripts"
HELPERS_DIR="$SCRIPTS_DIR/helpers"
@ -24,7 +29,7 @@ display_plugin_update_list() {
# displaying only installed plugins
if plugin_already_installed "$plugin"; then
local plugin_name="$(plugin_name_helper "$plugin")"
tmux_echo " $plugin_name"
tmux_echo " ${yellow}${plugin_name}${norm}"
fi
done

View file

@ -2,6 +2,13 @@
# this script handles core logic of updating plugins
if command -v tput >/dev/null; then
red=$(tput setaf 1)
green=$(tput setaf 2)
yellow=$(tput setaf 3)
norm=$(tput sgr0)
fi
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
HELPERS_DIR="$CURRENT_DIR/helpers"
@ -29,10 +36,10 @@ update() {
local plugin="$1" output
output=$(pull_changes "$plugin" 2>&1)
if (( $? == 0 )); then
echo_ok " \"$plugin\" update success"
echo_ok " \"${yellow}${plugin}${norm}\" ${green}update success${norm}"
echo_ok "$(echo "$output" | sed -e 's/^/ | /')"
else
echo_err " \"$plugin\" update fail"
echo_err " \"${yellow}${plugin}${norm}\" ${red}update fail${norm}"
echo_err "$(echo "$output" | sed -e 's/^/ | /')"
fi
}