Skip to content

Commit 971cbe2

Browse files
authored
Merge pull request #110 from edx/dkaplan1/APER-3925_move-pull-all-repos-in-directory-into-source-control
chore: adding convenience script to new utility dir
2 parents 2960ad3 + 3a3f015 commit 971cbe2

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

utils/README.rst

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
utils
2+
#####
3+
4+
This directory holds convenience and utility scripts that might be useful to
5+
users of devstack, but have no other home in source control.

utils/pull-all-repos-in-directory.sh

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/bin/bash
2+
3+
################
4+
5+
sync_directory() {
6+
IFS=$'\n'
7+
8+
for REPO in `ls "$1/"`
9+
do
10+
if [ -d "$1/$REPO" ]
11+
then
12+
echo "Updating $1/$REPO at `date`"
13+
if [ -d "$1/$REPO/.git" ]
14+
then
15+
git -C "$1/$REPO" pull
16+
else
17+
sync_directory "$1/$REPO"
18+
fi
19+
echo "Done at `date`"
20+
fi
21+
done
22+
}
23+
24+
REPOSITORIES="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
25+
26+
sync_directory $REPOSITORIES
27+

0 commit comments

Comments
 (0)