Skip to content

Commit

Permalink
only commit/push if there's a need to
Browse files Browse the repository at this point in the history
  • Loading branch information
Lifeismana committed Sep 4, 2024
1 parent b2da81a commit 874cb19
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -127,5 +127,7 @@ else
done
fi

git commit -m "$Commit_message | $(git status --porcelain | wc -l) files | $(git status --porcelain|awk '{print "basename " $2}'| sh | sed '{:q;N;s/\n/, /g;t q}')"
git push
if git diff-index --quiet HEAD; then
git commit -m "$Commit_message | $(git status --porcelain | wc -l) files | $(git status --porcelain|awk '{print "basename " $2}'| sh | sed '{:q;N;s/\n/, /g;t q}')"
git push
fi

0 comments on commit 874cb19

Please sign in to comment.