Add Linux and macOS execution commands
Some checks failed
Repo Quality / structure (push) Has been cancelled

This commit is contained in:
Rodrigo Pace
2026-05-08 12:25:51 -03:00
parent 703e072682
commit 97cab6d894
5 changed files with 184 additions and 8 deletions

28
scripts/reset-scenario.sh Normal file
View File

@@ -0,0 +1,28 @@
#!/usr/bin/env bash
set -euo pipefail
usage() {
echo "Usage: $0 <scenario> <connect_string> [sql_client]" >&2
}
if [[ $# -lt 2 ]]; then
usage
exit 1
fi
SCENARIO="$1"
CONNECT_STRING="$2"
SQL_CLIENT="${3:-sql}"
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
RESET_SCRIPT="$REPO_ROOT/scenarios/$SCENARIO/sql/99_reset.sql"
if [[ ! -f "$RESET_SCRIPT" ]]; then
echo "Reset script not found: $RESET_SCRIPT" >&2
exit 1
fi
echo "Resetting scenario $SCENARIO"
"$SQL_CLIENT" "$CONNECT_STRING" "@$RESET_SCRIPT"