Skip to content

Commit 1f47711

Browse files
committed
Upgrade init script
1 parent 466fdc5 commit 1f47711

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

2024/init.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
#!/bin/bash
22

3-
day="$(date '+%d')"
3+
day="$1"
4+
5+
if [ -z "$day" ]; then
6+
day="$(date '+%d')"
7+
fi
8+
9+
if [ -f "lib/day$day.ex" ]; then
10+
echo "Day already exists"
11+
exit 1
12+
fi
13+
414

515
cat > lib/day$day.ex <<- EOM
616
defmodule Day${day}a do

0 commit comments

Comments
 (0)