git-nostr-tools

git nostr tools
git clone git://jb55.com/git-nostr-tools
Log | Files | Refs

commit 07e5dfaa54742b85a470dd0d8f77ec1f07daaccb
parent f098f3ae5c52f5f144fc83c898d0c8f4171384d9
Author: William Casarin <jb55@jb55.com>
Date:   Sat, 19 Nov 2022 10:11:36 -0800

don't fail when fetching git configs

Diffstat:
Mgit-send-nostr | 8+++++---
Mgit-show-nostr | 6+++---
2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/git-send-nostr b/git-send-nostr @@ -1,5 +1,7 @@ #!/usr/bin/env bash +set -eo pipefail + NOSTR_RELAYER=${NOSTR_RELAYER:-nostcat} if ! command -v $NOSTR_RELAYER >&2 >/dev/null; then @@ -51,7 +53,7 @@ shift $((OPTIND-1)) if [ -z $relay ]; then - relay=$(git config nostr.relays) + relay=$(git config nostr.relays || :) if [[ $relay == "" ]]; then unset relay fi @@ -66,12 +68,12 @@ commit=$1 shift # this can be overridden -sec="$(git config nostr.secretkey)" +sec="$(git config nostr.secretkey || :)" if [[ $sec != "" ]]; then sec="--sec $sec" fi -hashtag=$(git config nostr.hashtag) +hashtag=$(git config nostr.hashtag || :) if [[ $hashtag != "" ]]; then hashtag="--tag t $hashtag" fi diff --git a/git-show-nostr b/git-show-nostr @@ -72,10 +72,10 @@ esac done if [ -z $relay ]; then - relay="$(git config nostr.relays)" + relay="$(git config nostr.relays || :)" fi -hashtag=$(git config nostr.hashtag) +hashtag=$(git config nostr.hashtag || :) if [[ "$hashtag" != "" ]]; then hashtag="-t $hashtag" fi @@ -106,7 +106,7 @@ if [ ! -z $writeout ]; then printf "saved results to %s\n" "$outname" >&2 fi -pager="$(git config core.pager)" +pager="$(git config core.pager || :)" if [ ! -t 1 ]; then pager=cat fi