This allows you to run git-paranoia on your current directory.
It will return 0 if everything is squeeky clean. This is useful
if for example you want to run a cronjob to update git trees but
never update them if you have any deltas in place of any kind.
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
}
if [[ -z $GIT_DIRS ]]; then
- echo -e "${RED}Error${NORMAL}:"
- echo -e "Set the ${CYAN}GIT_DIRS${NORMAL} environment variable with your list of git trees"
- echo
- usage $0
- exit 1
+ GIT_DIRS="${PWD}"
+ STAT="$(git status > /dev/null 2>&1 && echo $?)"
+ if [[ $STAT -ne 0 ]]; then
+ echo -e "${RED}Error${NORMAL}:"
+ echo -e "${PWD} not a git tree. Jump into one or set the "
+ echo -e "${CYAN}GIT_DIRS${NORMAL} environment variable with your list of git trees"
+ echo
+ usage $0
+ exit 1
+ fi
fi
while [ $# -ne 0 ]; do