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:
parent
a8e2de2266
commit
09a507a7ed
1 changed files with 7 additions and 0 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue