lerobot/robot-learning-tutorial
506
1#!/bin/bash2set -e3 4echo "๐ Starting Hugging Face Space..."5 6# Check if Notion import is enabled and token is available7if [ "${ENABLE_NOTION_IMPORT:-false}" = "true" ] && [ -n "$NOTION_TOKEN" ] && [ -n "$NOTION_PAGE_ID" ]; then8 echo "๐ Notion import enabled - fetching content from Notion..."9 echo " Page ID: $NOTION_PAGE_ID"10 11 cd /app12 13 # Run notion import14 if npm run notion:import 2>&1; then15 echo "โ
Notion import completed successfully!"16 17 # Rebuild the site with new content18 echo "๐จ Rebuilding site with Notion content..."19 npm run build 2>&120 21 # Generate PDF22 echo "๐ Generating PDF..."23 npm run export:pdf -- --theme=light --wait=full 2>&1 || echo "โ ๏ธ PDF generation failed (non-critical)"24 25 echo "โ
Site rebuilt and ready!"26 else27 echo "โ ๏ธ Notion import failed - using pre-built content from build time"28 fi29else30 if [ "${ENABLE_NOTION_IMPORT:-false}" = "true" ]; then31 echo "โ ๏ธ Notion import enabled but NOTION_TOKEN or NOTION_PAGE_ID not found"32 echo " NOTION_TOKEN: ${NOTION_TOKEN:+SET}${NOTION_TOKEN:-NOT SET}"33 echo " NOTION_PAGE_ID: ${NOTION_PAGE_ID:+SET}${NOTION_PAGE_ID:-NOT SET}"34 echo " โ Using pre-built content from build time"35 else36 echo "โญ๏ธ Notion import disabled - using pre-built content from build time"37 fi38fi39 40# Start nginx41echo "๐ Starting nginx on port 8080..."42exec nginx -g 'daemon off;'43 