day: Start an example file too
This commit is contained in:
parent
d9cd195ba7
commit
e724b8cfd4
1 changed files with 3 additions and 1 deletions
4
2022/day
4
2022/day
|
|
@ -7,11 +7,13 @@ BASEDIR=$(realpath "$(dirname "${BASH_SOURCE[0]}")")
|
||||||
N=$(printf '%02d\n' "$1")
|
N=$(printf '%02d\n' "$1")
|
||||||
|
|
||||||
input="${BASEDIR}/input/day${N}.txt"
|
input="${BASEDIR}/input/day${N}.txt"
|
||||||
|
example="${BASEDIR}/input/day${N}-ex.txt"
|
||||||
bin="${BASEDIR}/src/bin/day${N}.rs"
|
bin="${BASEDIR}/src/bin/day${N}.rs"
|
||||||
|
|
||||||
template="${BASEDIR}/src/bin/dayXX.rs.tmpl"
|
template="${BASEDIR}/src/bin/dayXX.rs.tmpl"
|
||||||
|
|
||||||
touch "${input}"
|
touch "${input}"
|
||||||
|
touch "${example}"
|
||||||
sed "s/dayXX/day${N}/g" "${template}" > "${bin}"
|
sed "s/dayXX/day${N}/g" "${template}" > "${bin}"
|
||||||
|
|
||||||
"${EDITOR}" -- "${input}" "${bin}"
|
"${EDITOR}" -- "${input}" "${example}" "${bin}"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue