Watch
1
0
Fork
You've already forked advent-of-code
0

Add Makefile shortcuts

This commit is contained in:
Jeremy Kaplan 2020-12-07 00:11:21 -08:00
commit 4e44365aff
2 changed files with 24 additions and 0 deletions

12
2020/Makefile Normal file
View file

@ -0,0 +1,12 @@
.DEFAULT_GOAL=day
DAY=0
.PHONY: day
day:
mkdir 'day$(DAY)'
sed 's/DayX/Day$(DAY)/g' template.ex > 'day$(DAY)/day$(DAY).ex'
touch 'day$(DAY)/input'
.PHONY: watch
watch:
ls 'day$(DAY)/day$(DAY).ex' | entr -c elixir /_

12
2020/template.ex Normal file
View file

@ -0,0 +1,12 @@
defmodule DayX do
defp read_input do
Path.expand('input', Path.dirname(__ENV__.file))
|> File.read!()
end
def part1 do
read_input()
end
end
DayX.part1() |> IO.inspect()