~rootmos/AoC

a5c249d1e8ac66293af6137c38c6ea9f1099e36b — Gustav Behm a month ago db8e9c4
Pick up the event being worked on from an .event flag
2 files changed, 10 insertions(+), 1 deletions(-)

M .gitignore
M aoc
M .gitignore => .gitignore +1 -0
@@ 1,1 1,2 @@
*.so
.event

M aoc => aoc +9 -1
@@ 7,7 7,15 @@ RUNNERS_DIR=$SCRIPT_DIR/run
TEMPLATES_DIR=$SCRIPT_DIR/templates
ROOT=${ROOT-$SCRIPT_DIR}

EVENT=${EVENT-$(date +%Y)}
EVENT=${EVENT-}
if [ -z "$EVENT" ]; then
     if [ -f "$ROOT/.event" ]; then
          EVENT=$(<"$ROOT/.event")
     else
          EVENT=$(date +%Y)
     fi
fi

DEFAULT_SUFFIX=${DEFAULT_SUFFIX-hs}
SUFFIX=${SUFFIX-$DEFAULT_SUFFIX}
ACTION=edit