From 76b0cb234f31367e05f63a2bfb2f1be650740f28 Mon Sep 17 00:00:00 2001 From: Yvan Roux Date: Fri, 13 Mar 2015 13:41:51 +0100 Subject: Add Configuration checking step: * git repo * gerrit --- backflip | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/backflip b/backflip index 7acbe90..31cb120 100755 --- a/backflip +++ b/backflip @@ -37,6 +37,11 @@ print_info() { echo -e "${blue}** ${NC}${1}" } +die() { + echo -e "${red}${bold}ERROR: ${NC}${bold}${1}${NC}" + exit 1 +} + # arg1 : a sentence # arg2 : a variable # print arg1 and gather user input in arg2 @@ -62,6 +67,23 @@ forge_entry() { fi } +# ============================================================================== +print_step "Checking Configuration" +# ============================================================================== +if ! git remote -v 2>&1 | grep "git@git.linaro.org" > /dev/null ; then + die "You're not in the right directory !" +fi +if [ ! -e .gitreview ]; then + print_info "Gerrit configuration (.gitreview) is missing, creating it." + cat <<- EOF > .gitreview +[gerrit] +host=review.linaro.org +port=29418 +project=toolchain/gcc +EOF +fi +print_info "${bold}OK${NC}" + # ============================================================================== print_step "Finding SHA1" # ============================================================================== -- cgit v1.2.3