1
0
Fork 0
This commit is contained in:
Arthur K. 2026-01-06 07:36:53 +03:00
parent c449dfcb5f
commit 559939e2f4
Signed by: wzray
GPG key ID: B97F30FDC4636357
49 changed files with 729 additions and 252 deletions

View file

@ -4,10 +4,6 @@ url="$(git remote get-url "${1:-origin}")"
if [[ "$url" =~ ^https?:\/\/ ]]; then
xdg-open "${url%.git}"
# elif [[ "$url" =~ ([a-zA-Z0-9_.-]+):(.*) ]]; then
# url="https://${BASH_REMATCH[1]}/${BASH_REMATCH[2]}"
# url="${url%.git}"
# xdg-open "$url"
elif [[ "$url" =~ ^[a-zA-Z0-9_-]+@([a-zA-Z0-9_.-]+):(.*) ]]; then
url="https://${BASH_REMATCH[1]}/${BASH_REMATCH[2]}"
url="${url%.git}"
@ -16,6 +12,10 @@ elif [[ "$url" =~ ^ssh://[a-zA-Z0-9_-]+@([a-zA-Z0-9_.-]+)/(.*) ]]; then
url="https://${BASH_REMATCH[1]}/${BASH_REMATCH[2]}"
url="${url%.git}"
xdg-open "$url"
elif [[ "$url" =~ ([a-zA-Z0-9_.-]+):(.*) ]]; then
url="https://${BASH_REMATCH[1]}/${BASH_REMATCH[2]}"
url="${url%.git}"
xdg-open "$url"
else
echo "TODO: $url"
fi