~kaction/forge-link

19384d70580cc62c2b5cb709798d89827d174110 — Dmitry Bogatov 1 year, 8 months ago e343311
Add support for github
1 files changed, 8 insertions(+), 0 deletions(-)

M forge-link
M forge-link => forge-link +8 -0
@@ 11,6 11,7 @@ file (optionally, with exact line) on web interface of one of known git
forges. Following forges are supported:

 * SourceHut
 * GitHub
EOF
	exit 1
fi


@@ 71,6 72,13 @@ for remote; do
		fi
	fi

	if [ "${base}" != "${base##https://github.com/}" ] ; then
		url="${base}/blob/${sha1}${relpath}"
		if [ "${line}" != 0 ] ; then
			url="${url}#L${line}"
		fi
	fi

	if [ -z "${url}" ] ; then
		continue
	fi