From f5e5d0b5f6b736d969d0aa849ee80167d681daee Mon Sep 17 00:00:00 2001 From: alexchao26 Date: Sun, 5 Dec 2021 15:10:46 -0500 Subject: [PATCH] update makefile scripts to run with only DAY set --- Makefile | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Makefile b/Makefile index 10e394f..dda89f1 100644 --- a/Makefile +++ b/Makefile @@ -13,6 +13,10 @@ skeleton: ## make skeleton main(_test).go files, optional: $DAY and $YEAR @ if [[ -n $$DAY && -n $$YEAR ]]; then \ go run scripts/cmd/skeleton/main.go -day $(DAY) -year $(YEAR); \ fi +# DAY only, use current year + @ if [[ -n $$DAY ]]; then \ + go run scripts/cmd/skeleton/main.go -day $(DAY); \ + fi # if DAY or YEAR are not set, allow the go binary to default to today @ if [[ -z $$DAY || -z $$YEAR ]]; then \ go run scripts/cmd/skeleton/main.go; \ @@ -23,6 +27,10 @@ input: check-aoc-cookie ## get input, requires $AOC_SESSION_COOKIE, optional: $D @ if [[ -n $$DAY && -n $$YEAR ]]; then \ go run scripts/cmd/input/main.go -day $(DAY) -year $(YEAR) -cookie $(AOC_SESSION_COOKIE); \ fi +# DAY only, use current year + @ if [[ -n $$DAY ]]; then \ + go run scripts/cmd/input/main.go -day $(DAY) -cookie $(AOC_SESSION_COOKIE); \ + fi # if DAY or YEAR are not yet, allow the go binary to default to today @ if [[ -z $$DAY || -z $$YEAR ]]; then \ go run scripts/cmd/input/main.go -cookie $(AOC_SESSION_COOKIE); \ @@ -33,6 +41,10 @@ prompt: check-aoc-cookie ## get prompt, requires $AOC_SESSION_COOKIE, optional: @ if [[ -n $$DAY && -n $$YEAR ]]; then \ go run scripts/cmd/prompt/main.go -day $(DAY) -year $(YEAR) -cookie $(AOC_SESSION_COOKIE); \ fi +# DAY only, use current year + @ if [[ -n $$DAY ]]; then \ + go run scripts/cmd/prompt/main.go -day $(DAY) -year $(YEAR) -cookie $(AOC_SESSION_COOKIE); \ + fi # if DAY or YEAR are not yet, allow the go binary to default to today @ if [[ -z $$DAY || -z $$YEAR ]]; then \ go run scripts/cmd/prompt/main.go -cookie $(AOC_SESSION_COOKIE); \