git-check, use the main branch for wiki projects.

This commit is contained in:
me
2026-08-24 16:36:18 -07:00
parent 77300f3b82
commit 753611fb67
+14 -14
View File
@@ -860,25 +860,25 @@ function git-check {
echo "Checking '$dir' for git changes."
ls -d "$dir"/* | while read project; do
if [[ ! -d $project ]]; then
continue
continue
fi
echo -e "\n*** `basename $project` ***"
cd $project
if [[ -d .git ]]; then
git ls-remote --exit-code --heads origin dev
dev_exists="$?"
if [[ "$dev_exists" == 0 ]]; then
git switch dev
elif [[ "$dev_exists" == 2 ]]; then
git switch main
git ls-remote --exit-code --heads origin dev
dev_exists="$?"
if [[ "$dev_exists" == 0 && "$dir" != *".wiki" ]]; then
git switch dev
elif [[ "$dev_exists" == 2 || "$dir" == *".wiki" ]]; then
git switch main
else
echo "ERROR: Unknown status for dev_exists, '$dev_exists'."
continue
fi
git pull
git push
else
echo "ERROR: Unknown status for dev_exists, '$dev_exists'."
continue
fi
git pull
git push
else
echo "Not a Git project, skipping!"
echo "Not a Git project, skipping!"
fi
done
echo -e "\nDone!"