Skip to content

Commit 466fdc5

Browse files
committed
Add init script
1 parent a55879b commit 466fdc5

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

2024/init.sh

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/bin/bash
2+
3+
day="$(date '+%d')"
4+
5+
cat > lib/day$day.ex <<- EOM
6+
defmodule Day${day}a do
7+
def run do
8+
File.read!(".input.txt") |> run
9+
end
10+
11+
def run(input) do
12+
end
13+
end
14+
EOM
15+
16+
cat > test/day${day}_test.exs <<- EOM
17+
defmodule Day${day}Test do
18+
use ExUnit.Case
19+
20+
def example, do: ""
21+
22+
test "Part 1 Example" do
23+
assert Day${day}a.run(example()) == :todo
24+
end
25+
26+
# test "Part 2 Example" do
27+
# assert Day${day}b.run(example()) == :todo
28+
# end
29+
end
30+
EOM

0 commit comments

Comments
 (0)