Also only git add if passed --commit

This commit is contained in:
Gwilym Inzani 2023-08-06 21:06:29 +01:00
parent 6607ea3f1f
commit b8ceb26bff

View file

@ -9,6 +9,7 @@ update_lockfiles
update_lockfiles
update_lockfiles
if [ "$1" == '--commit' ]; then
git add -u
if [ "$(git diff --cached --name-only)" == '' ]; then
@ -16,7 +17,6 @@ if [ "$(git diff --cached --name-only)" == '' ]; then
exit 0
fi
if [ "$1" == '--commit' ]; then
git -c user.name="GBA bot" -c user.email="gw@ilym.me" commit -m 'Update lockfiles'
git push
fi