#!/usr/bin/env bash rebuild=false while getopts r opt; do case $opt in r) rebuild=true;; *) echo 'invalid option given' >&2 exit 1 esac done if $rebuild; then echo "rebuilding the program" bin_path="$( cargo test --release --no-run --message-format json \ --target x86_64-unknown-linux-musl | jq -r 'select(.target.name == "revocatio_test").executable')" || exit cp "$bin_path" ./revocatio-test || exit sudo podman image rm revocatio-test sudo podman build -t revocatio/revocatio-test . || exit rm ./revocatio-test fi sudo podman run --name revocatio-test --rm revocatio/revocatio-test