Created
November 20, 2018 18:49
-
-
Save stevepaulo/42bc8653c7fd13172e14df59a906f9ee to your computer and use it in GitHub Desktop.
BASH script for updating all repos in a directory
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
YELLOW='\033[1;33m' | |
NC='\033[0m' # No Color | |
check_subdirs () { | |
curdir=`pwd` | |
for D in `find ${curdir} -type d -mindepth 1 -maxdepth 1`; do | |
if [ -d "${D}" ]; then | |
cd "${D}" | |
if [ -d '.git' ]; then | |
printf "${YELLOW}Pulling ${D}... ${NC}\n" | |
git pull | |
fi | |
check_subdirs | |
fi | |
done | |
} | |
check_subdirs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment