2025-03-03 18:04:52 -08:00

14 lines
525 B
Fish

function clean_repo_path
set stripped $argv[1]
set stripped (string replace -r "^http://" "" $stripped)
set stripped (string replace -r "^https://" "" $stripped)
set stripped (string replace -r "^git@" "" $stripped)
set stripped (string replace -r "^ssh://" "" $stripped)
set stripped (string replace -r "^aur@" "" $stripped)
set stripped (string replace -r ":" "/" $stripped)
if not string match -q "*/*" $stripped
set stripped "github.com/$stripped"
end
echo "$stripped"
end