Skip to content

Commit

Permalink
updated gitlab.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
HariSekhon committed Jun 12, 2024
1 parent 8b8bb57 commit c8ce7a9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/gitlab.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ gitlab_pull_request_url_regex='https://gitlab.com/[[:alnum:]/_-]+/pull/[[:digit:

get_gitlab_repo(){
git remote -v 2>/dev/null |
grep -E "gitlab\.${domain_regex}[/:]" |
grep -E "gitlab\.[[:alnum:].-]+[/:]" |
awk '{print $2}' |
head -n1 |
sed '
Expand All @@ -47,7 +47,7 @@ get_gitlab_repo(){
is_gitlab_origin(){
git remote -v |
# permitting generic domain regex for those self-hosting their own gitlab servers
grep -Eq "^origin.*gitlab\.${domain_regex}[/:]"
grep -Eq "^origin.*gitlab\.[[:alnum:].-]+[/:]"
}

check_gitlab_origin(){
Expand All @@ -60,9 +60,9 @@ gitlab_origin_owner_repo(){
local owner_repo
owner_repo="$(
git remote -v |
grep -Em1 '^origin.*gitlab\.${domain_regex}[/:]' |
grep -Em1 '^origin.*gitlab\.[[:alnum:].-]+[/:]' |
sed '
s|.*gitlab\.${domain_regex}[:/]||;
s|.*gitlab\.[[:alnum:].-]*[:/]||;
s/\.git.*//;
s/[[:space:]].*//
' ||
Expand Down

0 comments on commit c8ce7a9

Please sign in to comment.