Last active
December 30, 2015 05:19
-
-
Save andypotanin/7781509 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 | |
# | |
# To install globally: | |
# $ chmod +x vcs-update.sh | |
# $ ln /usr/local/bin/push push.sh | |
# | |
# Run "vcs-update" in terminal to update all directories. | |
# | |
DIRECTORIES=$PWD/* | |
echo "Committing and pushing all Git and SVN repositories in $DIRECTORIES"; | |
for DIRECTORY in $DIRECTORIES | |
do | |
if [ -d "$DIRECTORY/.git" ]; then | |
echo "Updating Git $DIRECTORY"; | |
cd $DIRECTORY | |
git add . | |
git commit -m "Automated commit." | |
git push | |
fi | |
if [ -d "$DIRECTORY/.svn" ]; then | |
echo "Updating SVN $DIRECTORY"; | |
cd $DIRECTORY | |
svn add . | |
svn commit -m "Automated commit." | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment