2023-06-14 21:10:24 +08:00
|
|
|
#!/bin/bash
|
2023-08-17 06:44:16 +08:00
|
|
|
|
|
|
|
# Exit immediately if a command exits with a non-zero status.
|
|
|
|
set -e
|
|
|
|
|
2023-08-15 05:43:21 +08:00
|
|
|
# This script runs all `burn` checks locally
|
|
|
|
#
|
|
|
|
# Run `run-checks` using this command:
|
|
|
|
#
|
|
|
|
# ./scripts/run-checks environment
|
|
|
|
#
|
|
|
|
# where `environment` can assume **ONLY** the following values:
|
|
|
|
#
|
|
|
|
# - `std` to perform checks using `libstd`
|
|
|
|
# - `no_std` to perform checks on an embedded environment using `libcore`
|
2023-08-17 06:44:16 +08:00
|
|
|
# - `typos` to check for typos in the codebase
|
2023-08-15 05:43:21 +08:00
|
|
|
#
|
2023-08-17 06:44:16 +08:00
|
|
|
# If no `environment` value has been passed, run all checks.
|
2023-08-15 05:43:21 +08:00
|
|
|
|
|
|
|
# Compile run-checks binary
|
|
|
|
rustc scripts/run-checks.rs --crate-type bin --out-dir scripts
|
|
|
|
|
|
|
|
# Run binary passing the first input parameter, who is mandatory.
|
|
|
|
# If the input parameter is missing or wrong, it will be the `run-checks`
|
|
|
|
# binary which will be responsible of arising an error.
|
|
|
|
./scripts/run-checks $1
|