dotfiles/config/updateall/scripts/70-git

21 lines
336 B
Text
Raw Normal View History

2024-04-12 09:39:27 +02:00
#!/usr/bin/env sh
[ -z "$SSH_AGENT_PID" ] && exec ssh-agent -- "$0" "$@"
ssh-add
update_repo() {
2024-04-12 09:39:27 +02:00
cd -- "$1" || return
printf 'Updating repository \033[1m%s\033[0m...\n' "$1"
git pull
}
cd ~/git || exit
for i in *; do
while [ "$(jobs -p | wc -l)" -ge 4 ]; do
sleep 1
done
2024-04-12 09:39:27 +02:00
update_repo "$i" &
done
wait