_dump/upd-forks.sh

26 lines
362 B
Bash
Raw Normal View History

2024-02-24 14:31:19 +01:00
#!/usr/bin/env zsh
GIT_DIRS_PATH='/Forks'
if [ ! -z "$1" ]; then
GIT_DIRS_PATH="$1"
fi
FORKS=( `/bin/ls -A1 "$GIT_DIRS_PATH"` )
for FORK in "${FORKS[@]}"; do
if [ -d "$GIT_DIRS_PATH/$FORK" ]; then
cd "$GIT_DIRS_PATH/$FORK"
if [ -e "`pwd`/.git" ]; then
echo "
> '$GIT_DIRS_PATH/$FORK'"
git pull --depth 1
fi
cd "$GIT_DIRS_PATH"
fi
done