Skip to content

Instantly share code, notes, and snippets.

@stevepaulo
Created November 20, 2018 18:49
Show Gist options
  • Save stevepaulo/42bc8653c7fd13172e14df59a906f9ee to your computer and use it in GitHub Desktop.
Save stevepaulo/42bc8653c7fd13172e14df59a906f9ee to your computer and use it in GitHub Desktop.
BASH script for updating all repos in a directory
#!/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