Skip to content

Instantly share code, notes, and snippets.

@borkweb
Last active August 29, 2015 14:21
Show Gist options
  • Select an option

  • Save borkweb/96c014184f1da9ea3516 to your computer and use it in GitHub Desktop.

Select an option

Save borkweb/96c014184f1da9ea3516 to your computer and use it in GitHub Desktop.
#!/bin/bash
#########################
# This bash script pulls the latest plugin code for whichever branch is checked out
#
# Optionally checks out a branch before pulling.
#
# Example: mtup develop
#########################
repos=()
repos+=('the-events-calendar')
repos+=('events-pro')
repos+=('events-community')
repos+=('events-community-tickets')
repos+=('events-eventbrite')
repos+=('events-facebook')
repos+=('events-filterbar')
repos+=('events-importer-ical')
repos+=('events-tickets-edd')
repos+=('events-tickets-shopp')
repos+=('events-tickets-woo')
repos+=('events-tickets-wpec')
for i in "${repos[@]}"
do
echo '-------------------'
if [ -d $i ]; then
echo $i
cd $i
if [ -n $1 ]; then
git co $1
fi
git pull
[ -f .gitmodules ] && git submodule update --recursive --init
cd ../
else
echo "${i} doesn't exist in this directory. Perhaps you aren't in executing this from plugins?"
fi
done
echo '-------------------'
echo 'DONE'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment