Created
March 19, 2018 17:28
-
-
Save radub/ac08ed3e9b5df3b52da74c1b98d826fe to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env bash | |
VENDOR_LOCATION='' | |
for i in "$@" | |
do | |
case $i in | |
-l=*|--location=*) | |
VENDOR_LOCATION="${i#*=}" | |
shift | |
;; | |
-h) | |
echo Usage: execute with no trailing slash ./recpull.sh -l="{path_to_dir}" | |
exit | |
esac | |
done | |
if [ -d $VENDOR_LOCATION ]; then | |
cd $VENDOR_LOCATION | |
else | |
echo 'Please specify vendor directory location!' | |
exit | |
fi | |
for f in $VENDOR_LOCATION/* | |
do | |
if [ -d ${f} ]; then | |
# Will not run if no directories are available | |
echo Pulling latest on $f; | |
git pull; | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment