24 lines
434 B
Bash
Executable file
24 lines
434 B
Bash
Executable file
#!/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
|
|
|