forked from minirust/minirust
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mini
executable file
·37 lines (32 loc) · 927 Bytes
/
mini
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
#!/bin/bash
# Helper script for working with MiniRust.
# Usage:
# - `./mini test`: run the test suite
# - `./mini run file.rs`: run a Rust file with MiniRust
##############################################################
set -e
## The part that is always needed
# Fixed specr-transpile version
SPECR_VERSION="0.1.30"
# Stricter checks on CI
if [ -n "$CI" ]; then
export RUSTFLAGS="-D warnings"
export CARGOFLAGS="--locked"
fi
cargo install "specr-transpile@${SPECR_VERSION}"
specr-transpile specr.toml --check
## Dispath to specific command
COMMAND="$1"
shift
case "$COMMAND" in
test)
cargo test --manifest-path=tooling/minitest/Cargo.toml $CARGOFLAGS "$@"
cargo test --manifest-path=tooling/minimize/Cargo.toml $CARGOFLAGS "$@"
;;
run)
exec cargo run --manifest-path=tooling/minimize/Cargo.toml -- "$@"
;;
*)
echo "Invalid command."
exit 1
esac