diff options
| -rw-r--r-- | README.md | 3 | ||||
| -rw-r--r-- | Taskfile.yml | 20 |
2 files changed, 7 insertions, 16 deletions
@@ -0,0 +1,3 @@ +# Advent of Code + +Solutions to the puzzles found at https://adventofcode.com/ 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 |
