Skip to content

Instantly share code, notes, and snippets.

@radub
Created March 19, 2018 17:28
Show Gist options
  • Save radub/ac08ed3e9b5df3b52da74c1b98d826fe to your computer and use it in GitHub Desktop.
Save radub/ac08ed3e9b5df3b52da74c1b98d826fe to your computer and use it in GitHub Desktop.
#!/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