Updated pullall function

This commit is contained in:
Phil 2021-01-22 17:28:58 +00:00
parent b9888285ab
commit 8a679661c2

View File

@ -73,7 +73,11 @@ function pullall() {
cd "$dir" || exit 1
# If it's a git directory, then update it
if test -d .git; then
if [ "$(grep -c "[branch "master"]" .git/config )" -gt 0 ]; then
echo "$dir is a Git repo. Pulling master branch..." && git checkout master && git pull && echo ""
elif [ "$(grep -c "[branch "main"]" .git/config )" -gt 0 ]; then
echo "$dir is a Git repo. Pulling main branch..." && git checkout main && git pull && echo ""
fi
else
echo "$dir is not a Git repo." && echo ""
fi