Skip to content

Commit

Permalink
Merge pull request #110 from edx/dkaplan1/APER-3925_move-pull-all-rep…
Browse files Browse the repository at this point in the history
…os-in-directory-into-source-control

chore: adding convenience script to new utility dir
  • Loading branch information
deborahgu authored Feb 18, 2025
2 parents 2960ad3 + 3a3f015 commit 971cbe2
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
5 changes: 5 additions & 0 deletions utils/README.rst
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.
27 changes: 27 additions & 0 deletions utils/pull-all-repos-in-directory.sh
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

0 comments on commit 971cbe2

Please sign in to comment.