Disable error output for git. Add check for both operations

This commit is contained in:
RealStickman 2022-07-04 20:18:31 +02:00
parent f795428e45
commit 3c208483a4

View File

@ -17,8 +17,13 @@ for dir in "${dirs[@]}"; do
# change into that directory
cd "$dir"
# try to check out master or main branch
git checkout -q master \
|| git checkout -q main
git checkout -q master 2>/dev/null \
|| git checkout -q main 2>/dev/null
# check whether the previous two commands failed
if [ $? -ne 0 ]; then
printf "Couldn't find master or main branches\n"
exit 1
fi
git fetch --all
git pull
done