17 lines
342 B
Shell
Executable file
17 lines
342 B
Shell
Executable file
#!/usr/bin/env bash
|
|
|
|
set -euo pipefail
|
|
|
|
BASEDIR=$(realpath "$(dirname "${BASH_SOURCE[0]}")")
|
|
|
|
N=$(printf '%02d\n' "$1")
|
|
|
|
input="${BASEDIR}/input/day${N}.txt"
|
|
bin="${BASEDIR}/src/bin/day${N}.rs"
|
|
|
|
template="${BASEDIR}/src/bin/dayXX.rs.tmpl"
|
|
|
|
touch "${input}"
|
|
sed "s/dayXX/day${N}/g" "${template}" > "${bin}"
|
|
|
|
"${EDITOR}" -- "${input}" "${bin}"
|