24 lines
521 B
Bash
Executable File
24 lines
521 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
cd "$ROOT"
|
|
|
|
if ! command -v cargo >/dev/null 2>&1; then
|
|
echo "error: Rust/Cargo is required" >&2
|
|
exit 1
|
|
fi
|
|
|
|
if find "$ROOT" -type f \( -name '*.ts' -o -name '*.tsx' \) -print -quit | grep -q .; then
|
|
echo "error: TypeScript source found in RustBox" >&2
|
|
exit 1
|
|
fi
|
|
|
|
cargo test --locked
|
|
cargo build --release --locked
|
|
|
|
BIN="$ROOT/target/release/rustbox"
|
|
test -x "$BIN"
|
|
"$BIN" --version
|
|
printf 'Built RustBox: %s\n' "$BIN"
|