View Source mix aoc (Advent of Code Utils v5.0.0)
Create a code skeleton and fetch input for the AOC challenge of a day / year.
This mix task runs mix aoc.gen followed by mix aoc.get. Afterwards, it prints the url of
today's challenge. Please refer to mix help aoc.gen and mix help aoc.get for more
information.
mix aoc.gen
This task creates a code skeleton for the AOC challenge of a given day / year. The generated
code is written to lib/<year>/<day>.ex. Optionally, a unit test file is generated in
test/<year>/<day>_test.exs. The location where files are created can be customized.
mix aoc.get
This task fetches the input and example inputs for a given day and year and stores it in
input/<year>_<day>.txt and input/<year>_<day>_example_<n>.txt. In order for this task to
work, your session cookie should be passed as a command line argument or set up in the
:advent_of_code_utils application environment.
Configuration
Application environment
The following application configuration parameters can modify the behaviour of this task:
day: Specify the day. Defaults to the current day.year: Specify the year. Defaults to the current year.time_zone: Specify the time-zone used to determine the local time. Defaults to the time zone of your computer. Please refer to the README for additional information.session: Advent of code sessions cookie. Needed to allowmix aoc.getto fetch your personal puzzle input.input_path: Determines wheremix aoc.getstores the input file. Defaults to"input/:year_:day.txt"example_path: Determines wheremix aoc.getstores the example inputs. Defaults to"input/:year_:day_example_:n.txt"gen_tests?: Determines ifmix aoc.gencreates test files. Defaults tofalse.gen_doctests?: Determines ifmix aoc.gencreates doctests. Defaults to the value ofgen_tests?.code_path: Determines wheremix aoc.genstores the generated code file. Defaults to"lib/:year/:day.ex".code_path: Determines wheremix aoc.genstores the generated test file. Defaults to"test/:year/:day_test.exs"
Command-line arguments
-yor--year: Specify the year.-dor--day: Specify the day.-sor--session: Specify the session cookie.--example: Fetch example input (the default)--no-example: Do not fetch example input-tor--test: Generate tests.--no-test: Do not generate tests.--doctestor--no-doctest: Enable or disable the creation of doctests.
All of these options take precedence over their application environment counterparts.