diff --git a/.config/helix/scripts/get_git_provider_url.fish b/.config/helix/scripts/get_git_provider_url.fish index 9ce59c4f..80a956d3 100755 --- a/.config/helix/scripts/get_git_provider_url.fish +++ b/.config/helix/scripts/get_git_provider_url.fish @@ -1,5 +1,8 @@ #!/usr/bin/env fish +# Original script from Reddit (forget URL) +# sr.ht support added by ficd + function get_git_provider_url --argument filename line_number # Check if inside a git repository if not git rev-parse --is-inside-work-tree >/dev/null 2>&1 @@ -23,7 +26,7 @@ function get_git_provider_url --argument filename line_number set repo_path (echo $remote_url | perl -nE 'say $2 if /\.com(:|\/)(.*)\.git/') else if string match -q '*git.sr.ht*' $remote_url set provider srht - set repo_path (string match -r '.*:(~.+)' $remote_url) + set repo_path (string match -r -g '.*:(~.+)' $remote_url) else echo "Error: Unsupported git provider." return 1