AutoYADM commit: 2025-04-03 16:25:18
This commit is contained in:
parent
a770120992
commit
db8f406079
1 changed files with 4 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue