Time runs
This commit is contained in:
parent
737730d54a
commit
c5470de9ea
1 changed files with 5 additions and 7 deletions
12
justfile
12
justfile
|
@ -6,23 +6,21 @@ year := "2023"
|
||||||
file := "src/bin/" + day + ".rs"
|
file := "src/bin/" + day + ".rs"
|
||||||
|
|
||||||
# Format, lint, and run the program for today.
|
# Format, lint, and run the program for today.
|
||||||
run: _output-folder
|
run:
|
||||||
rustfmt src/bin/{{day}}.rs
|
|
||||||
cargo clippy
|
cargo clippy
|
||||||
# Hide warning here because we just ran clippy
|
# Hide warning here because we just ran clippy
|
||||||
RUSTFLAGS=-Awarnings cargo run --release --bin {{day}}
|
RUSTFLAGS=-Awarnings cargo build --release --bin {{day}}
|
||||||
|
time ./target/release/{{day}}
|
||||||
|
|
||||||
# Begin working on todays problem. Downloads input, creates template and opens the problem and code.
|
# Begin working on todays problem. Downloads input, creates template and opens the problem and code.
|
||||||
begin: _input-folder
|
begin: _input-folder
|
||||||
echo "use aoc2023::*; const INPUT: &str = include_str!(\"../../input/{{day}}\"); const TEST_INPUT: &str = include_str!(\"../../input/{{day}}-test\"); fn main() {}" >> {{file}}
|
echo "const INPUT: &str = include_str!(\"../../input/{{day}}\"); const TEST_INPUT: &str = include_str!(\"../../input/{{day}}-test\"); fn main() {}" >> {{file}}
|
||||||
rustfmt {{file}}
|
rustfmt {{file}}
|
||||||
curl --silent "https://adventofcode.com/{{year}}/day/{{dayWithout0}}/input" -H "Cookie: session=$AOC_SESSION" > "input/{{day}}"
|
curl --silent "https://adventofcode.com/{{year}}/day/{{dayWithout0}}/input" -H "Cookie: session=$AOC_SESSION" > "input/{{day}}"
|
||||||
touch input/{{day}}-test
|
touch input/{{day}}-test
|
||||||
rustrover {{file}}
|
rustrover {{file}}
|
||||||
|
rustrover input/{{day}}-test
|
||||||
open "https://adventofcode.com/{{year}}/day/{{dayWithout0}}"
|
open "https://adventofcode.com/{{year}}/day/{{dayWithout0}}"
|
||||||
|
|
||||||
_output-folder:
|
|
||||||
mkdir -p output
|
|
||||||
|
|
||||||
_input-folder:
|
_input-folder:
|
||||||
mkdir -p input
|
mkdir -p input
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue