#!/bin/bash
# Update the diagnostic app when bicorder.json changes

echo "Checking for bicorder.json..."
if [ ! -f "../bicorder.json" ]; then
    echo "Error: ../bicorder.json not found!"
    exit 1
fi

echo "Building app with latest bicorder.json..."
npm run build

if [ $? -eq 0 ]; then
    echo ""
    echo "✓ Build successful!"
    echo "The app has been updated with the latest bicorder.json structure."
    echo "Deploy the 'dist' folder to your web server or run 'npm run preview' to test."
else
    echo ""
    echo "✗ Build failed. Please check the errors above."
    exit 1
fi
