mirror of
https://github.com/Crocmagnon/advent-of-code.git
synced 2024-12-21 21:31:53 +01:00
19 lines
403 B
Bash
Executable file
19 lines
403 B
Bash
Executable file
#!/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
|
|
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
|
|
mkdir -p inputs
|
|
touch inputs/day$1
|
|
touch inputs/day$1-test1
|
|
git add "inputs/day$1*" $filename
|