Something went wrong. Try again.
fork of hey-api/openapi-ts because I need some additional things
Something went wrong. Try again.
1.4 kB · 37 lines
Shell
at main
1234567891011121314151617181920212223242526272829303132333435363738#!/usr/bin/env bash
# Check if generated client code for all examples is up-to-date# This script is used in CI to ensure examples are kept in sync with the codebase
set -e
# Get the directory of this scriptSCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"ROOT_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
echo "Checking if generated code is up-to-date..."
# Generate fresh code"$SCRIPT_DIR/examples-generate.sh"
# Check if there are any changesif ! git diff --quiet; then echo "" echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" echo "❌ ERROR: Generated code is out of sync!" echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" echo "" echo "The following files have changed:" git diff --name-only echo "" echo "To fix this, run:" echo " pnpm examples:generate" echo "" echo "Then commit the changes." exit 1fi
echo ""echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"echo "✅ All generated code is up-to-date!"echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"