#!/usr/bin/env bash
set -euo pipefail

SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
PYTHON_BIN="/Users/wangguolin/.cache/codex-runtimes/codex-primary-runtime/dependencies/python/bin/python3"

if [ ! -x "$PYTHON_BIN" ]; then
  echo "找不到 Codex 自带 Python：$PYTHON_BIN"
  exit 1
fi

if [ $# -lt 1 ]; then
  echo "用法：$0 /绝对路径/davos_assessment_full.sql [输出目录]"
  exit 1
fi

"$PYTHON_BIN" "$SCRIPT_DIR/export_backup_dataset.py" --input "$1" ${2:+--output-dir "$2"}
