From 6bb35ed5b530f7c0db84fd1f6a18ee57284d5951 Mon Sep 17 00:00:00 2001 From: Connor Olding Date: Tue, 4 Oct 2022 02:25:37 -0700 Subject: [PATCH] util: add sourcehut support to acquire --- notwa-util/acquire | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/notwa-util/acquire b/notwa-util/acquire index 97d6e83..dc65470 100755 --- a/notwa-util/acquire +++ b/notwa-util/acquire @@ -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 : \