Skip to content

Commit 851ba1f

Browse files
committed
makefile: add new script for creating new solutions
1 parent ed005c7 commit 851ba1f

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

Makefile

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
1-
test:
1+
new-solution: check-lib
2+
@cargo init --lib crates/$(lib)
3+
4+
test: check-lib
25
@cargo test -p $(lib) --lib -- --nocapture
36

47
lint:
5-
cargo clippy --all-targets --all-features
8+
@cargo clippy --all-targets --all-features
9+
10+
11+
check-lib:
12+
@if [ -z "$(lib)" ]; then \
13+
echo "Error: 'lib' argument is required."; \
14+
exit 1; \
15+
fi
16+

0 commit comments

Comments
 (0)