2025-03-05 11:05:35 -08:00

16 lines
425 B
Fish

function _repo_open
set remote (git remote get-url origin)
set remote (string replace -r "git@" "https://" $remote)
set remote (string replace -r "^https://([^/]+):" "https://\$1/" $remote)
if not command -q xdg-open
echo "Error: xdg-open command not found"
return 1
end
if not xdg-open "$remote" 2>/dev/null
echo "Error: Failed to open $remote"
return 1
end
end