Require explicit data setup option
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user