Skip to content

Instantly share code, notes, and snippets.

@ScreamingDev
Last active December 17, 2015 14:39
Show Gist options
  • Save ScreamingDev/5626200 to your computer and use it in GitHub Desktop.
Save ScreamingDev/5626200 to your computer and use it in GitHub Desktop.
Get the latest for all repos in your project map / directory
#!/bin/sh
#
# requires: https://github.com/aanand/git-up
# run in the dir you keep your projects
#
for dir in `find -maxdepth 1 -mindepth 1 -type d`;
do # update git and run xdeploy
if [ -d $dir/.git ]; then # it can run git-up
echo "";
echo `basename $dir`;
cd $dir && git up && cd ..; # early break if we cannot access the dir
fi;
if [ -f $dir/xdeploy.xml ]; then # run
echo "xdeploy...";
cd $dir && php xdeploy.php --update --dev >/dev/null 2>&1 && cd ..;
fi;
done;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment