summaryrefslogtreecommitdiff
path: root/Taskfile.yml
diff options
context:
space:
mode:
Diffstat (limited to 'Taskfile.yml')
-rw-r--r--Taskfile.yml20
1 files changed, 4 insertions, 16 deletions
diff --git a/Taskfile.yml b/Taskfile.yml
index b9e8cfe..dfbcb39 100644
--- a/Taskfile.yml
+++ b/Taskfile.yml
@@ -8,29 +8,17 @@ tasks:
desc: Prints this message
cmds:
- cmd: task --list-all
- day:setup:
+ day:input:
desc: Creates the files needed to solve a day of Advent of Code
requires:
vars:
- YEAR
- DAY
- - LANG
vars:
FORMATTED_DAY: '{{if (lt (atoi .DAY) 10)}}0{{.DAY}}{{else}}{{.DAY}}{{end}}'
- cmds:
- - cmd: mkdir --parents {{.YEAR}}/{{.LANG}}/day_{{.FORMATTED_DAY}}
- - task: fetch-input
- silent: true
- fetch-input:
- desc: Fetches your input from adventofcode.com for the specified day
- internal: true
- requires:
- vars:
- - YEAR
- - DAY
- vars:
URI: https://adventofcode.com/{{ .YEAR }}/day/{{.DAY}}/input
- FORMATTED_DAY: '{{if (lt (atoi .DAY) 10)}}0{{.DAY}}{{else}}{{.DAY}}{{end}}'
+ INPUT_DIR: '{{.YEAR}}/_input'
cmds:
- - cmd: curl --cookie 'session={{.SESSION}}' {{.URI}} > {{.YEAR}}/_input/day_{{.FORMATTED_DAY}}.txt
+ - cmd: mkdir --parents {{.INPUT_DIR}}
+ - cmd: curl --cookie 'session={{.SESSION}}' {{.URI}} > {{.INPUT_DIR}}/day_{{.FORMATTED_DAY}}.txt
silent: true