Skip to content

Commit 4b3bcea

Browse files
committed
New script to create a new aoc day in 2023.
1 parent fb55d76 commit 4b3bcea

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

new-day-2023.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash
2+
3+
year=2023
4+
day=${1}
5+
printf -v dd %02d "${day}"
6+
dir="${year}/${dd}"
7+
name="y${year}d${dd}"
8+
message="${year} day ${day}."
9+
10+
if [[ -a $dir ]]; then
11+
echo >&2 "Path ${dir} already exists."
12+
exit 1
13+
fi
14+
15+
jj new -m "${message}" || exit
16+
cp -r template "${dir}" || exit
17+
cargo init --name "${name}" "${dir}"

0 commit comments

Comments
 (0)