Improved new script
This commit is contained in:
parent
22e26996ad
commit
5cb00bb9a9
|
@ -4,13 +4,14 @@ type=$2
|
|||
default=$3
|
||||
test=$4
|
||||
|
||||
day_trimmed=$(echo $1 | sed 's/^0*//')
|
||||
|
||||
echo "Creating file from template..."
|
||||
sed -e "s/DAY/$day/g" -e "s/TYPE/$type/" -e "s/DEFAULT/$default/" -e "s/TEST/$test/" ./template.rs > ./src/bin/day${day}.rs
|
||||
sed -e "s/DAY/$day_trimmed/g" -e "s/TYPE/$type/" -e "s/DEFAULT/$default/" -e "s/TEST/$test/" ./template.rs > ./src/bin/day${day}.rs
|
||||
|
||||
echo "Downloading input..."
|
||||
source ../.env
|
||||
mkdir -p input/$1
|
||||
day=$(echo $1 | sed 's/^0*//')
|
||||
curl -s "https://adventofcode.com/2023/day/$day/input" -H "Cookie: session=${SESSION}" > input/$1/input
|
||||
curl -s "https://adventofcode.com/2023/day/$day_trimmed/input" -H "Cookie: session=${SESSION}" > input/$1/input
|
||||
|
||||
echo "Done!"
|
||||
|
|
Loading…
Reference in New Issue
Block a user