Require explicit data setup option

This commit is contained in:
aseimel
2026-06-15 14:56:22 +02:00
parent 241e9e8a8d
commit 79abf60cc1
3 changed files with 40 additions and 9 deletions
+20 -2
View File
@@ -1,14 +1,32 @@
#!/usr/bin/env bash
set -euo pipefail
MODE="${1:---dry-run}"
usage() {
cat >&2 <<'EOF'
Usage: bash data-setup/run_data_setup.sh <option>
Options:
--dry-run check setup scripts only
--download-only download source files where scriptable
--build-test rebuild inputs from existing local sources
--compare compare regenerated inputs with committed data/
--full-test download, rebuild, and compare locally
EOF
}
if [ "$#" -ne 1 ]; then
usage
exit 1
fi
MODE="$1"
repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd -P)"
cd "$repo_root"
case "$MODE" in
--dry-run|--download-only|--build-test|--compare|--full-test) ;;
*)
echo "Usage: $0 [--dry-run|--download-only|--build-test|--compare|--full-test]" >&2
usage
exit 1
;;
esac