From 87afb5fd5eb75f1d1c287b9cc1c66741a79100e1 Mon Sep 17 00:00:00 2001 From: Brendan Burns Date: Sat, 14 Jun 2014 15:37:39 -0700 Subject: [PATCH] Further error handling when gcloud isn't set up correctly. --- release/config.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/release/config.sh b/release/config.sh index 74bde46c37a..078624053a5 100755 --- a/release/config.sh +++ b/release/config.sh @@ -19,8 +19,18 @@ if [ "$(which gcloud)" == "" ]; then exit 1 fi +if [ -n "$(gcloud auth list 2>&1 | grep 'No credentialed accounts')" ]; then + gcloud auth login +fi + PROJECT=$(gcloud config list project | tail -n 1 | cut -f 3 -d ' ') +if [ ! -n "$PROJECT" ]; then + echo "Default project is not set." + echo "Please run gcloud config set project " + exit 1 +fi + if which md5 > /dev/null; then HASH=$(md5 -q -s $PROJECT) else