Updated pullall function
This commit is contained in:
parent
b9888285ab
commit
8a679661c2
@ -73,7 +73,11 @@ function pullall() {
|
|||||||
cd "$dir" || exit 1
|
cd "$dir" || exit 1
|
||||||
# If it's a git directory, then update it
|
# If it's a git directory, then update it
|
||||||
if test -d .git; then
|
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 ""
|
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
|
else
|
||||||
echo "$dir is not a Git repo." && echo ""
|
echo "$dir is not a Git repo." && echo ""
|
||||||
fi
|
fi
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user