advent-of-code/2022/new_day

20 lines
403 B
Text
Raw Normal View History

2022-12-02 13:42:42 +01:00
#!/bin/bash
set -euxo pipefail
if [[ $# -ne 2 ]]; then
>&2 echo "Usage: $0 <number> <python_module_name>"
exit 2
fi
filename=day$1_$2.py
cp template.py $filename
2022-12-04 19:09:11 +01:00
if [ "$(uname -s)" == "Linux" ]; then
sed -e "s/dayXX/day$1/g" -i ./$filename
else
sed -e "s/dayXX/day$1/g" -i "" ./$filename
fi
2022-12-02 13:42:42 +01:00
mkdir -p inputs
touch inputs/day$1
touch inputs/day$1-test1
2022-12-11 12:58:35 +01:00
git add "inputs/day$1*" $filename