#!/bin/bash

# This script copies the SDK files to the test-app directory and updates the HTML

# Build the SDK
echo "Building the SDK..."
cd ../sdk
npm run build:dev
cd ../test-app

# Create directories
mkdir -p ./sdk-dist

# Copy SDK files
echo "Copying SDK files..."
cp -r ../sdk/dist/* ./sdk-dist/

# Update the HTML to use the local SDK files
echo "Updating HTML..."
sed -i 's|<script id="sdk-script"></script>|<script src="./sdk-dist/index.js"></script>|g' index.html
sed -i 's|<style id="sdk-styles"></style>|<link rel="stylesheet" href="./sdk-dist/cursor.css">|g' index.html

echo "Done! SDK files copied and HTML updated."