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,14 +9,14 @@ update_lockfiles
update_lockfiles update_lockfiles
update_lockfiles update_lockfiles
git add -u
if [ "$(git diff --cached --name-only)" == '' ]; then
echo "No files updated"
exit 0
fi
if [ "$1" == '--commit' ]; then if [ "$1" == '--commit' ]; then
git add -u
if [ "$(git diff --cached --name-only)" == '' ]; then
echo "No files updated"
exit 0
fi
git -c user.name="GBA bot" -c user.email="gw@ilym.me" commit -m 'Update lockfiles' git -c user.name="GBA bot" -c user.email="gw@ilym.me" commit -m 'Update lockfiles'
git push git push
fi fi