From eab36128628c43aaa72696002d4f0f34403edcdc Mon Sep 17 00:00:00 2001 From: Klesh Wong Date: Sat, 24 Sep 2022 15:57:45 +0800 Subject: [PATCH] fix: org name should be dynamically detected --- bin/gpr | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/gpr b/bin/gpr index 76ac3fe..725f6a9 100755 --- a/bin/gpr +++ b/bin/gpr @@ -5,6 +5,7 @@ # UPSTREAM must be a https github url BRANCH=$(git branch --show-current) +UPSTREAM_BRANCH=$(git remote show upstream | grep -oP 'HEAD branch: \K\w+') ORIGIN_URL=$(git remote get-url origin) case "$ORIGIN_URL" in git@github.com:*) @@ -17,7 +18,7 @@ UPSTREAM_URL=$(echo "$UPSTREAM_URL" | sed 's/.git$//') echo ORIGIN_ORG: $ORIGIN_ORG echo UPSTREAM_URL: $UPSTREAM_URL git push -f -u origin $BRANCH -x-open "$UPSTREAM_URL/compare/main...merico-dev:$BRANCH?expand=1" +x-open "$UPSTREAM_URL/compare/$UPSTREAM_BRANCH...$ORIGIN_ORG:$BRANCH?expand=1" sleep 2 command -v awesome-client && awesome-client ' local awful = require("awful")