From e504b8eec68b85e4e1562db756307446add3eff3 Mon Sep 17 00:00:00 2001 From: Franklin Yu Date: Thu, 5 Jan 2023 20:37:06 -0800 Subject: [PATCH] Show the output of Git pull when updating plugins This tells users whether a plugin changed during the update. --- scripts/update_plugin.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/scripts/update_plugin.sh b/scripts/update_plugin.sh index 68bf605..e533664 100755 --- a/scripts/update_plugin.sh +++ b/scripts/update_plugin.sh @@ -26,10 +26,15 @@ pull_changes() { } update() { - local plugin="$1" - $(pull_changes "$plugin" > /dev/null 2>&1) && - echo_ok " \"$plugin\" update success" || + local plugin="$1" output + output=$(pull_changes "$plugin" 2>&1) + if (( $? == 0 )); then + echo_ok " \"$plugin\" update success" + echo_ok "$(echo "$output" | sed -e 's/^/ | /')" + else echo_err " \"$plugin\" update fail" + echo_err "$(echo "$output" | sed -e 's/^/ | /')" + fi } update_all() {