From 715fa13926719610a7dc32f96b60baac966c3098 Mon Sep 17 00:00:00 2001 From: Wryn Wagner Date: Tue, 6 Aug 2019 14:40:49 -0600 Subject: [PATCH] RentDynamics git branch cleanup utility added --- bash/rentdynamics | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/bash/rentdynamics b/bash/rentdynamics index d1a48c3..296506f 100644 --- a/bash/rentdynamics +++ b/bash/rentdynamics @@ -40,3 +40,19 @@ function refresh_rd_db() { psql postgres -c "DROP DATABASE rdrentplus;" psql postgres -c "CREATE DATABASE rdrentplus with owner rd;" } + +function rntbranchcleanup() { + for dir in $(ls $RD_PATH); do + rnt $dir >/dev/null 2>/dev/null; + if [ -d .git ]; then + printf "clearing repository $dir..."; + git branch -d $(git branch | sed -E "/develop|master|\*/d") >/dev/null 2>/dev/null; + printf "done!\n"; + else + echo $dir is not a git repository; + fi + rnt; + done; + echo && echo RentDynamics repository branches all clean! +} +