util: add sourcehut support to acquire

This commit is contained in:
Connor Olding 2022-10-04 02:25:37 -07:00
parent 6abe53acf8
commit 6bb35ed5b5

View File

@ -41,7 +41,7 @@
|| exit \
;done \
&& { [ "${#from}" != 0 ] || die "missing a required key: from" ;} \
&& if [ "$from" = github ] \
&& if [ "$from" = github ] || [ "$from" = sourcehut ] \
;then : \
&& missing key repo "$repo" \
&& missing key commit "$commit" \
@ -55,7 +55,11 @@
;fi \
&& remote_fn="$commit.tar.gz" \
&& local_fn="$username!$project-$remote_fn" \
&& remote_url="https://github.com/$repo/archive/$remote_fn" \
&& pathy="$repo/archive/$remote_fn" \
&& case "$from" in
(github) remote_url="https://github.com/$pathy" ;; \
(sourcehut) remote_url="https://git.sr.ht/~$pathy" ;; \
esac \
&& sha256="$checksum" \
&& { [ "${#dest}" != 0 ] || dest="${repo##*/}" ;} \
;else : \