-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathrun.sh
More file actions
45 lines (38 loc) · 701 Bytes
/
run.sh
File metadata and controls
45 lines (38 loc) · 701 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
#!/bin/bash
# Run tests
run::test() {
RUSTFLAGS="${RUSTFLAGS} -A dead_code" \
cargo test
}
# Run the CLI on the fly
run::cli() {
RUSTFLAGS="${RUSTFLAGS} -A dead_code" \
cargo run -- "$@"
}
# Compile project
run::build() {
cargo build --release
}
# Run one of the demo folders
run::demo() {
local which="$1"
shift 1
assert-demo "${which}"
run::cli "$@" "demo/${which}1" "demo/${which}2"
}
# Format all code
run::format() {
rustfmt src/**
}
# Generate demo folders
run::demo-generate() {
local which="$1"
assert-demo "${which}"
"./demo/${which}.sh"
}
assert-demo() {
local which="$1"
[[ -f "./demo/${which}.sh" ]] && return
echo 'No such demo' 1>&2
exit 1
}