From aacb9de41ca44b43e1f832382735078545fdad29 Mon Sep 17 00:00:00 2001 From: Menno van Leeuwen Date: Thu, 22 Aug 2024 16:18:18 +0200 Subject: [PATCH] chore: Refactor dotf script to display unpushed commit count --- bin/dotf | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/bin/dotf b/bin/dotf index 372909a..2a0f969 100755 --- a/bin/dotf +++ b/bin/dotf @@ -18,13 +18,11 @@ logo() { printfe "%s" "green" "[$(git -C ~/dotfiles status --porcelain | grep -c '^M ')] staged " fi - printfe "%s" "blue" "[$(git -C ~/dotfiles rev-parse --short HEAD)]" - println "" "normal" - - # Check if we have commits to push + printfe "%s" "blue" "[$(git -C ~/dotfiles rev-parse --short HEAD)] " if [[ $(git -C ~/dotfiles log origin/master..HEAD) ]]; then - printfe "%s" "yellow" "[!] You have $(git -C ~/dotfiles log origin/master..HEAD --oneline | wc -l | tr -d ' ') commits to push" + printfe "%s" "yellow" "[!] You have $(git -C ~/dotfiles log origin/master..HEAD --oneline | wc -l | tr -d ' ') commit(s) to push" fi + println "" "normal" if [[ $continue_eitherway == "continue" ]]; then return