chore: Refactor dotf script to display unpushed commit count

This commit is contained in:
Menno van Leeuwen 2024-08-22 16:18:18 +02:00
parent 56132c53fc
commit aacb9de41c

View File

@ -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