Last active
August 29, 2015 14:06
-
-
Save tranma/3f1943b44d4c391f05c0 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
DEV_DIR=$1 | |
REPOS=("package1" "package2") | |
RED='\033[1;33m' | |
BLUE='\033[1;31m' | |
NC='\033[0m' | |
if [[ -z $DEV_DIR ]] | |
then | |
DEV_DIR=$(pwd) | |
fi | |
echo "Looking in $DEV_DIR for repos" | |
for thing in $DEV_DIR/* ; | |
do | |
if [[ -d $thing ]] | |
then | |
name=$(basename $thing) | |
if [[ " ${REPOS[*]} " == *" $name"* ]]; | |
then | |
cd $thing | |
branch=$(git rev-parse --abbrev-ref HEAD) | |
echo -e "Updating branch ${RED}$branch${NC} of ${BLUE}$thing${NC}..." | |
git pull origin $branch | |
fi | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment