Disable error output for git. Add check for both operations
This commit is contained in:
parent
72496aae5f
commit
9790c3c336
@ -17,8 +17,13 @@ for dir in "${dirs[@]}"; do
|
|||||||
# change into that directory
|
# change into that directory
|
||||||
cd "$dir"
|
cd "$dir"
|
||||||
# try to check out master or main branch
|
# try to check out master or main branch
|
||||||
git checkout -q master \
|
git checkout -q master 2>/dev/null \
|
||||||
|| git checkout -q main
|
|| 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 fetch --all
|
||||||
git pull
|
git pull
|
||||||
done
|
done
|
||||||
|
Loading…
Reference in New Issue
Block a user