#!/usr/bin/env bash
if [ -z “$1″ ]; then
PATH_START=$HOME”/REPOS”
cd $PATH_START
else
PATH_START=$1
cd $PATH_START
PATH_START=$(pwd)
fi
DIR_REPOS=($(ls -d */))
printf “\nstart DIR: “$PATH_START”\n”
for dir in “${DIR_REPOS[@]}”; do
CURRENT=$PATH_START”/”$dir
echo “repo: “$CURRENT
if [ -d “$CURRENT.git/” ]; then
cd $CURRENT
git fetch origin && git pull
fi
done