pull-all.sh
1 #!/bin/bash 2 # Pull all git repositories in the Radicle folder 3 4 SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 5 RADICLE_DIR="$(cd "$SCRIPT_DIR/../.." && pwd)" 6 7 echo "Updating all repositories in $RADICLE_DIR" 8 echo "==========================================" 9 10 for dir in "$RADICLE_DIR"/*/; do 11 if [ -d "$dir/.git" ]; then 12 repo_name=$(basename "$dir") 13 echo "" 14 echo "[$repo_name]" 15 git -C "$dir" pull --ff-only 2>&1 | sed 's/^/ /' 16 fi 17 done 18 19 echo "" 20 echo "Done."