-
Notifications
You must be signed in to change notification settings - Fork 1
/
Justfile
36 lines (29 loc) · 1.03 KB
/
Justfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
_default:
@just --list
check:
cargo clippy --locked
cargo fmt -- --check
fix:
cargo clippy --fix --locked -- -D warnings
test year day:
cargo nextest run -p aoc{{year}}-day-{{day}}
run year day part:
cargo run -p aoc{{year}}-day-{{day}} --bin part{{part}}
bench year day:
cargo bench -p aoc{{year}}-day-{{day}}
[no-cd]
create year day:
@if [ ! -d {{source_directory()}}/{{year}} ]; then \
mkdir {{source_directory()}}/{{year}}; \
fi
@cd {{source_directory()}}/{{year}}; \
cargo generate --path {{source_directory()}}/daily-template --name day-{{day}} --define year={{year}} --define day={{day}}
@if ! {{source_directory()}}/scripts/get-aoc-input.py {{year}} day-{{day}} --cwd {{source_directory()}} --timeout 60; then \
echo "Failed to get input for day-{{day}} of year {{year}}"; \
echo "Cleaning up..."; \
rm -rf {{source_directory()}}/{{year}}/day-{{day}}; \
exit 1; \
fi
[private]
cleanup year day:
@rm -rf {{source_directory()}}/{{year}}/day-{{day}}