fix: org name should be dynamically detected

This commit is contained in:
Klesh Wong 2022-09-24 15:57:45 +08:00
parent c35040650c
commit eab3612862

View File

@ -5,6 +5,7 @@
# UPSTREAM must be a https github url # UPSTREAM must be a https github url
BRANCH=$(git branch --show-current) BRANCH=$(git branch --show-current)
UPSTREAM_BRANCH=$(git remote show upstream | grep -oP 'HEAD branch: \K\w+')
ORIGIN_URL=$(git remote get-url origin) ORIGIN_URL=$(git remote get-url origin)
case "$ORIGIN_URL" in case "$ORIGIN_URL" in
git@github.com:*) git@github.com:*)
@ -17,7 +18,7 @@ UPSTREAM_URL=$(echo "$UPSTREAM_URL" | sed 's/.git$//')
echo ORIGIN_ORG: $ORIGIN_ORG echo ORIGIN_ORG: $ORIGIN_ORG
echo UPSTREAM_URL: $UPSTREAM_URL echo UPSTREAM_URL: $UPSTREAM_URL
git push -f -u origin $BRANCH 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 sleep 2
command -v awesome-client && awesome-client ' command -v awesome-client && awesome-client '
local awful = require("awful") local awful = require("awful")