From 4d0bd914e7c1ee65f4036e60149a7b891906a5d3 Mon Sep 17 00:00:00 2001 From: George Abbott Date: Tue, 31 Oct 2023 17:54:07 +0000 Subject: Commit all to date. --- wr/evmnhol | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 wr/evmnhol (limited to 'wr/evmnhol') diff --git a/wr/evmnhol b/wr/evmnhol new file mode 100755 index 0000000..ef56204 --- /dev/null +++ b/wr/evmnhol @@ -0,0 +1,16 @@ +#!/bin/sh +# evmnhol +# First set EVMNHOL_DIR as the directory in $HOME/docs/wr/lle/hol/ to write to, +# then run evmnhol with the date you want to write to. + + +if [ -z "$EVMNHOL_DIR" ] ; then echo "EVMNHOL_DIR is not set"; return; fi +if [ -z "$1" ] ; then echo "You need to pass a date"; return; else DT="$1" fi +if [ ! -d "$HOLIDAY/$EVMNHOL_DIR" ] ; then echo "$HOLIDAY/$EVMNHOL_DIR does not exist"; return; fi + +# TODO: add logic to verify the date using md. But check md actually +# exists first. Use date +%s -d "$(cat md | grep begin | cut -d'=' -f2)" + +mkdir -p "$HOME/docs/wr/lle/$(date +%Y-%m -d $DT)" +wr "lle/$(date +%Y-%m -d $DT)/H$(date --iso-8601 -d $DT).txt" +ln -s "../../$(date +%Y-%m -d $DT)/H$(date --iso-8601 -d $DT).txt" "$HOLIDAY/$EVMNHOL_DIR/H$(date --iso-8601 -d $DT).txt" -- cgit v1.2.1