1
0
mirror of https://github.com/jb55/nostril.git synced 2025-08-11 19:10:46 -04:00
Files
deps
scripts
nostr-contact
nostr-post
nostr-query
nostr-relay-note
.envrc
.gitignore
.gitmodules
Makefile
README.md
aes.c
aes.h
base64.c
base64.h
compiler.h
configurator.c
cursor.h
default.nix
endian.h
hex.h
nostril.c
proof.h
random.h
sha256.c
sha256.h
shell.nix
nostril/scripts/nostr-post
William Casarin 7a01bc0cf7 add some handy script
Signed-off-by: William Casarin <jb55@jb55.com>
2022-04-23 07:52:41 -07:00

30 lines
420 B
Bash
Executable File

#!/usr/bin/env bash
set -e
TMP=$(mktemp)
$EDITOR "$TMP"
if [ ! -f "$TMP" ]; then
printf "could not create temporary file\n" >&2
exit 1
fi
content="$(cat $TMP)"
re="^[[:space:]]*$"
if [[ "$content" =~ $re ]]; then
printf "note empty. aborting.\n" >&2
exit 2
fi
note=$(nostril "$@" --content "$content")
printf "relaying:\n" >&2
printf "$note\n"
<<<"$note" nostr-relay-note
printf "done.\n" >&2
rm -f "$TMP"