diff options
Diffstat (limited to 'wr/mnholmd')
-rwxr-xr-x | wr/mnholmd | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/wr/mnholmd b/wr/mnholmd new file mode 100755 index 0000000..f359ff2 --- /dev/null +++ b/wr/mnholmd @@ -0,0 +1,18 @@ +#!/bin/sh +# mnholmd: Create the metadata file for a holiday file. +# mnholmd <date> <place-name> + +if [ -z "$HOLIDAY" ] ; then HOL="$HOLIDAY" else HOL="$HOME/docs/wr/lle/hol" fi +if [ -z "$1" ] ; then + # TODO: add logic to verify the date is valid + echo "You need to provide a date parameter"; return; fi +if [ -z "$2" ] ; then echo "Please enter a place where you went."; + return; fi +# logic +if [ ! -d "$HOL/$1-$2" ] ; then echo "$1-$2 does not exist"; return; fi +if [ -f "$HOL/$1-$2/md" ] ; then + nvim "$HOL/$1-$2/md" +else + echo "begin=\nend=\nwith=\nat=\n" >> "$HOL/$1-$2/md" + nvim "$HOL/$1-$2/md" +fi |