refresh all git repos

This commit is contained in:
tengel 2024-09-14 10:36:19 -05:00
parent b89320d456
commit 3878013afc

24
shell/reporefresh.sh Executable file
View file

@ -0,0 +1,24 @@
#!/usr/bin/env bash
#
# SPDX-License-Identifier: MIT
# parent tree of repos
WDIR="/home/user/gitrepos"
function reporefresh() {
for repo in [a-z]*; do
if [[ -d "${repo}/.git" && ! -L "${repo}" ]]; then
pushd "$(pwd)" >/dev/null || return
cd "${repo}" && echo "${repo}"
git pull
popd >/dev/null || return
sleep 1
fi
done
}
cd "${WDIR}" || exit 1
echo "Refreshing ${WDIR}"
reporefresh
echo