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

@ -19,12 +19,10 @@ logo() {
fi
printfe "%s" "blue" "[$(git -C ~/dotfiles rev-parse --short HEAD)] "
println "" "normal"
# Check if we have commits to push
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