#!/bin/bash # Trigo Hugging Face Space Deployment Script # This script copies the trigo-web project to the HF Space repo and prepares it for deployment set -e echo "๐Ÿš€ Trigo HF Space Deployment Script" echo "====================================" echo "" # Define paths PROJECT_ROOT="/home/camus/work/trigo" TRIGO_WEB="$PROJECT_ROOT/trigo-web" HF_SPACE="$PROJECT_ROOT/third_party/trigo-hfspace" # Check if directories exist if [ ! -d "$TRIGO_WEB" ]; then echo "โŒ Error: trigo-web directory not found at $TRIGO_WEB" exit 1 fi if [ ! -d "$HF_SPACE" ]; then echo "โŒ Error: HF Space directory not found at $HF_SPACE" exit 1 fi echo "๐Ÿ“‚ Project directory: $TRIGO_WEB" echo "๐Ÿ“‚ HF Space directory: $HF_SPACE" echo "" # Clean up old trigo-web in HF space if it exists if [ -d "$HF_SPACE/trigo-web" ]; then echo "๐Ÿงน Cleaning up old trigo-web directory..." rm -rf "$HF_SPACE/trigo-web" fi # Copy trigo-web to HF space echo "๐Ÿ“ฆ Copying trigo-web to HF Space repository..." cp -r "$TRIGO_WEB" "$HF_SPACE/" # Remove node_modules and dist folders (will be built in Docker) echo "๐Ÿงน Removing node_modules and dist folders (will be rebuilt in Docker)..." find "$HF_SPACE/trigo-web" -type d -name "node_modules" -exec rm -rf {} + 2>/dev/null || true find "$HF_SPACE/trigo-web" -type d -name "dist" -exec rm -rf {} + 2>/dev/null || true # Remove test files echo "๐Ÿงน Removing test files..." rm -rf "$HF_SPACE/trigo-web/tests" 2>/dev/null || true echo "" echo "โœ… Files prepared successfully!" echo "" echo "๐Ÿ“‹ Next steps:" echo " 1. cd $HF_SPACE" echo " 2. git add ." echo " 3. git commit -m 'Deploy Trigo game'" echo " 4. git push" echo "" echo "๐ŸŒ After pushing, HF will automatically build and deploy your app." echo ""