From 3859ca31198b13c02375296c7299d1e9839d372e Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Mon, 26 Oct 2020 10:20:22 +0100 Subject: [PATCH] g review: check if 'gh' is authenticated already Signed-off-by: Miklos Vajna Change-Id: I689348489f89d74b10782302d7bea57a845e36d4 --- g | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/g b/g index 67b5955dc..3424c6ea3 100755 --- a/g +++ b/g @@ -16,6 +16,11 @@ if [ "$1" == "review" ]; then exit 1 fi + if ! gh auth status &>/dev/null; then + echo "'gh' thinks you are not logged into any GitHub hosts. Run 'gh auth login' to authenticate." + exit 1 + fi + # e.g. co-4-2 BRANCH=$(git symbolic-ref HEAD|sed 's|refs/heads/||') # e.g. origin