diff --git a/utils/README.rst b/utils/README.rst new file mode 100644 index 0000000000..323beec790 --- /dev/null +++ b/utils/README.rst @@ -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. diff --git a/utils/pull-all-repos-in-directory.sh b/utils/pull-all-repos-in-directory.sh new file mode 100644 index 0000000000..ac2205c25f --- /dev/null +++ b/utils/pull-all-repos-in-directory.sh @@ -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 +