Commit ac9f76db by Brian Beggs Committed by Brian Beggs

Add repo status make target

parent 77d38119
......@@ -32,6 +32,9 @@ dev.provision: | check-memory dev.provision.run stop ## Provision dev environmen
dev.reset: | down dev.repo.reset pull dev.up static update-db ## Attempts to reset the local devstack to a the master working state
dev.status: ## Prints the status of all git repositories
./repo.sh status
dev.repo.reset: ## Attempts to reset the local repo checkouts to the master working state
./repo.sh reset
......
......@@ -59,7 +59,7 @@ reset ()
name="${BASH_REMATCH[1]}"
if [ -d "$name" ]; then
cd $name;git reset --hard HEAD;git checkout master;git pull;cd "$currDir"
cd $name;git reset --hard HEAD;git checkout master;git reset --hard origin/master;git pull;cd "$currDir"
else
printf "The [%s] repo is not cloned. Continuing.\n" $name
fi
......@@ -67,6 +67,23 @@ reset ()
cd - &> /dev/null
}
status ()
{
currDir=$(pwd)
for repo in ${repos[*]}
do
[[ $repo =~ $name_pattern ]]
name="${BASH_REMATCH[1]}"
if [ -d "$name" ]; then
printf "\nGit status for [%s]:\n" $name
cd $name;git status;cd "$currDir"
else
printf "The [%s] repo is not cloned. Continuing.\n" $name
fi
done
cd - &> /dev/null
}
if [ "$1" == "clone" ]; then
clone
......@@ -75,4 +92,6 @@ elif [ "$1" == "reset" ]; then
if [[ $REPLY =~ ^[Yy]$ ]]; then
reset
fi
elif [ "$1" == "status" ]; then
status
fi
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment