From a8a5f31903fc8a32ebd49a62a84f5131f7a0ee02 Mon Sep 17 00:00:00 2001 From: Rob Watson Date: Mon, 17 May 2021 11:28:27 +0200 Subject: [PATCH] ghpr: check if on an invalid-looking branch --- script/ghpr | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/script/ghpr b/script/ghpr index b919912..07d5fb0 100755 --- a/script/ghpr +++ b/script/ghpr @@ -4,6 +4,12 @@ export GH_NO_UPDATE_NOTIFIER=1 +currentbranch="$(git bn)" +if [ "$currentbranch" = "staging" ] || [ "$currentbranch" = "master" ]; then + echo "Are you sure? Currently on branch '$currentbranch'" + exit 1 +fi + output=$(gh pr view -w 2>&1) exitcode=$?