#!/usr/bin/env bash # Publishes legal/ to Surge (free static hosting) for preview or production. # Usage: ./scripts/publish-legal-site.sh [subdomain] # Example: ./scripts/publish-legal-site.sh app-for-indeed set -euo pipefail ROOT="$(cd "$(dirname "$0")/.." && pwd)" LEGAL="$ROOT/legal" DOMAIN="${1:-app-for-indeed}" if ! command -v npx >/dev/null 2>&1; then echo "Error: npx is required (install Node.js)." >&2 exit 1 fi echo "Publishing $LEGAL to https://${DOMAIN}.surge.sh" cd "$LEGAL" npx --yes surge . "${DOMAIN}.surge.sh" echo "" echo "Live URLs:" echo " https://${DOMAIN}.surge.sh/index.html" echo " https://${DOMAIN}.surge.sh/home.html" echo " https://${DOMAIN}.surge.sh/support.html" echo " https://${DOMAIN}.surge.sh/contact.html" echo " https://${DOMAIN}.surge.sh/terms-of-service.html" echo " https://${DOMAIN}.surge.sh/privacy-policy.html"