1
0
Fork 0
mirror of https://git.sr.ht/~seirdy/seirdy.one synced 2024-11-27 14:12:09 +00:00

internal: allow new-note script to take a reply URI

This commit is contained in:
Rohan Kumar 2022-07-10 22:40:37 -07:00
parent a8e2de2266
commit 09a507a7ed
No known key found for this signature in database
GPG key ID: 1E892DB2A5F84479

View file

@ -27,6 +27,7 @@ bad_option() {
} }
reply='0' reply='0'
url=''
while getopts "hr" flags; do while getopts "hr" flags; do
case ${flags} in case ${flags} in
@ -37,6 +38,8 @@ while getopts "hr" flags; do
r) r)
reply='1' reply='1'
shift shift
url="$1"
shift
;; ;;
*) *)
bad_option "${flags}" 'invalid option' bad_option "${flags}" 'invalid option'
@ -53,6 +56,10 @@ else
hugo new "$filename" hugo new "$filename"
fi fi
if [ "$url" != '' ]; then
sd -s 'replyURI: ""' "replyURI: \"$url\"" "content/$filename"
fi
"${EDITOR-nvim}" "content/$filename" "${EDITOR-nvim}" "content/$filename"
# vi:ft=sh # vi:ft=sh