2023-08-07 18:51:45 +00:00
|
|
|
#!/usr/bin/env bash
|
2023-08-07 17:18:47 +00:00
|
|
|
|
2023-08-07 18:51:45 +00:00
|
|
|
set -euo pipefail
|
|
|
|
|
|
|
|
if [ ! -z "$MODULE" ]; then
|
2023-08-07 17:18:47 +00:00
|
|
|
MODULE="-p $MODULE"
|
|
|
|
fi
|
|
|
|
|
2023-08-07 18:51:45 +00:00
|
|
|
if [ -z "${PARAMS-}" ]; then
|
|
|
|
PARAMS=""
|
|
|
|
fi
|
|
|
|
|
2023-08-07 17:18:47 +00:00
|
|
|
case $CMD in
|
|
|
|
build)
|
|
|
|
$CARGO build $MODULE $PARAMS
|
|
|
|
;;
|
|
|
|
test)
|
|
|
|
$CARGO test $MODULE $PARAMS
|
|
|
|
;;
|
2023-08-07 20:43:06 +00:00
|
|
|
run)
|
|
|
|
$CARGO run $MODULE $PARAMS
|
|
|
|
;;
|
2023-08-07 17:18:47 +00:00
|
|
|
release)
|
2023-08-07 20:43:06 +00:00
|
|
|
$CARGO run --release $MODULE $PARAMS
|
2023-08-07 17:18:47 +00:00
|
|
|
;;
|
|
|
|
clean)
|
|
|
|
$CARGO clean $MODULE
|
|
|
|
;;
|
|
|
|
"")
|
2023-08-07 20:43:06 +00:00
|
|
|
echo "No command specified. Use build | test | run | release | clean"
|
2023-08-07 17:18:47 +00:00
|
|
|
;;
|
|
|
|
*)
|
2023-08-07 20:43:06 +00:00
|
|
|
echo "$CMD is unknown. Use build | test | run | release | clean"
|
2023-08-07 17:18:47 +00:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|