forked from openedx-unsupported/devstack
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #110 from edx/dkaplan1/APER-3925_move-pull-all-rep…
…os-in-directory-into-source-control chore: adding convenience script to new utility dir
- Loading branch information
Showing
2 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
utils | ||
##### | ||
|
||
This directory holds convenience and utility scripts that might be useful to | ||
users of devstack, but have no other home in source control. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/bash | ||
|
||
################ | ||
|
||
sync_directory() { | ||
IFS=$'\n' | ||
|
||
for REPO in `ls "$1/"` | ||
do | ||
if [ -d "$1/$REPO" ] | ||
then | ||
echo "Updating $1/$REPO at `date`" | ||
if [ -d "$1/$REPO/.git" ] | ||
then | ||
git -C "$1/$REPO" pull | ||
else | ||
sync_directory "$1/$REPO" | ||
fi | ||
echo "Done at `date`" | ||
fi | ||
done | ||
} | ||
|
||
REPOSITORIES="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
|
||
sync_directory $REPOSITORIES | ||
|