diff --git a/generate_models.sh b/generate_models.sh index 95cd086..4e867ae 100755 --- a/generate_models.sh +++ b/generate_models.sh @@ -27,6 +27,13 @@ if ! command -v git &> /dev/null; then exit 1 fi +# Check if uv is installed before cloning or modifying generated files +if ! command -v uv &> /dev/null; then + echo "Error: uv not found." + echo "Please install uv: curl -LsSf https://astral.sh/uv/install.sh | sh" + exit 1 +fi + # UCP Version to use (if provided, use release/$1 branch; otherwise, use main) if [ -z "$1" ]; then BRANCH="main" @@ -60,13 +67,6 @@ uv run python preprocess_schemas.py echo "Generating Pydantic models from preprocessed schemas..." -# Check if uv is installed -if ! command -v uv &> /dev/null; then - echo "Error: uv not found." - echo "Please install uv: curl -LsSf https://astral.sh/uv/install.sh | sh" - exit 1 -fi - # Ensure output directory is clean rm -r -f "$OUTPUT_DIR" mkdir -p "$OUTPUT_DIR"