mirror of
https://git.sr.ht/~seirdy/seirdy.one
synced 2024-11-10 00:12:09 +00:00
internal: allow new-note script to take a reply URI
This commit is contained in:
parent
a8e2de2266
commit
09a507a7ed
1 changed files with 7 additions and 0 deletions
|
@ -27,6 +27,7 @@ bad_option() {
|
|||
}
|
||||
|
||||
reply='0'
|
||||
url=''
|
||||
|
||||
while getopts "hr" flags; do
|
||||
case ${flags} in
|
||||
|
@ -37,6 +38,8 @@ while getopts "hr" flags; do
|
|||
r)
|
||||
reply='1'
|
||||
shift
|
||||
url="$1"
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
bad_option "${flags}" 'invalid option'
|
||||
|
@ -53,6 +56,10 @@ else
|
|||
hugo new "$filename"
|
||||
fi
|
||||
|
||||
if [ "$url" != '' ]; then
|
||||
sd -s 'replyURI: ""' "replyURI: \"$url\"" "content/$filename"
|
||||
fi
|
||||
|
||||
"${EDITOR-nvim}" "content/$filename"
|
||||
|
||||
# vi:ft=sh
|
||||
|
|
Loading…
Reference in a new issue