agb/.github/scripts/update-lockfiles.sh
2023-08-06 21:06:29 +01:00

22 lines
439 B
Bash
Executable file

#!/usr/bin/env bash
function update_lockfiles() {
find . -name Cargo.lock -execdir cargo update \;
}
update_lockfiles
update_lockfiles
update_lockfiles
update_lockfiles
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 push
fi