commit d88f63d099dcabbd72a59e5defdb2bf0f9dfdd69
parent b1a1a05f92af11fc2b857ed92209adcf265f6243
Author: William Casarin <jb55@jb55.com>
Date: Sat, 19 Nov 2022 10:04:00 -0800
send: use configured project hashtag like show
Diffstat:
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/git-send-nostr b/git-send-nostr
@@ -71,10 +71,16 @@ if [[ $sec != "" ]]; then
sec="--sec $sec"
fi
+hashtag=$(git config nostr.hashtag)
+if [[ $hashtag != "" ]]; then
+ printf "using hashtag $hashtag\n" >&2
+ hashtag="--tag t $hashtag"
+fi
+
patch="$(git format-patch --stdout $commit)"
subject=$(<<<"$patch" grep "^Subject:"| head -n1 | sed 's,^Subject: ,,')
author=$(<<<"$patch" grep "^From:"| head -n1 | sed 's,^From: ,,')
-json=$(nostril --envelope $sec --kind 19691228 --tag author "$author" --tag subject "$subject" --content "$patch" "$@")
+json=$(nostril --envelope $sec --kind 19691228 $hashtag --tag author "$author" --tag subject "$subject" --content "$patch" "$@")
id=$(jq -r '.[1].id' <<<"$json")