-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
45 lines (37 loc) · 980 Bytes
/
Copy pathjustfile
File metadata and controls
45 lines (37 loc) · 980 Bytes
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
37
38
39
40
41
42
43
44
45
target_dir := join(home_dir(), "bin")
utils := replace(
replace_regex(
replace_regex(
shell("fd '^main\\.rs$' crates/ -X dirname"),
"(?m)^crates/", ""
),
"(?m)/src$", ""
),
"\n", " "
)
default:
@just --list
# Cargo fmt
fmt:
@cargo fmt
# Clean cargo artefacts
clean:
@cargo clean
# Build everything
build:
cargo build --release
# Install everything automatically
install-all: build
@mkdir -p {{target_dir}}
@for util in {{utils}}; do \
install -vDm755 "target/x86_64-unknown-linux-musl/release/$util" "{{target_dir}}/$util"; \
done
# Install just a single specific utility
install utility:
@echo "Building and installing {{utility}}..."
@cargo build --release -p {{utility}}
@mkdir -p {{target_dir}}
@install -vDm755 "target/x86_64-unknown-linux-musl/release/{{utility}}" "{{target_dir}}/{{utility}}"; \
# Run all tests in release mode
test:
cargo test --release