2023-07-11 17:53:00 +03:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
case $1 in
|
|
|
|
debug|release)
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "Usage: build_and_run.sh [type] where is type is 'debug' or 'release'" >&2
|
|
|
|
exit 1
|
|
|
|
esac
|
|
|
|
|
|
|
|
type=$1
|
|
|
|
[[ ${type} == "release" ]] && release_param+=(--release)
|
|
|
|
cargo build ${release_param[@]} --target x86_64-unknown-linux-gnu
|
|
|
|
|
|
|
|
if [ $? -eq 0 ]
|
|
|
|
then
|
2023-08-06 18:56:53 +03:00
|
|
|
./target/x86_64-unknown-linux-gnu/${type}/grim
|
2023-07-11 17:53:00 +03:00
|
|
|
fi
|