#!/bin/bash set -e # Configuration - Paths relative to project root POC_REPO_PATH="../client-krow-poc" WEB_POC_SOURCE="$POC_REPO_PATH/prototypes/web/krow_web_application" WEB_DEST="internal/launchpad/prototypes/web" # Colors GREEN='\033[0;32m' BLUE='\033[0;34m' RED='\033[0;31m' NC='\033[0m' # No Color echo -e "${BLUE}🚀 Starting Prototypes Synchronization...${NC}" # Check if POC repo exists if [ ! -d "$POC_REPO_PATH" ]; then echo -e "${RED}❌ Error: POC repository not found at $POC_REPO_PATH${NC}" echo "Please clone the repository adjacent to this one:" echo " cd .. && git clone git@github.com:Oloodi/client-krow-poc.git" exit 1 fi # --- Sync Web Dashboard --- echo -e "${BLUE}📦 Building Web Dashboard Prototype...${NC}" if [ -d "$WEB_POC_SOURCE" ]; then cd "$WEB_POC_SOURCE" echo " -> Installing dependencies..." pnpm install --silent echo " -> Building dist..." pnpm run build # Go back to project root cd - > /dev/null echo " -> Deploying to Launchpad..." # Ensure destination exists and is clean (remove old files but keep .keep if needed, though usually we wipe for a clean build) rm -rf "$WEB_DEST"/* mkdir -p "$WEB_DEST" # Copy build artifacts cp -R "$WEB_POC_SOURCE/dist/"* "$WEB_DEST/" echo -e "${GREEN}✅ Web Dashboard synced successfully.${NC}" else echo -e "${RED}⚠️ Warning: Web POC source directory not found at $WEB_POC_SOURCE${NC}" fi # --- Future: Sync Mobile Prototypes --- # Add logic here when mobile prototypes are ready to be built for web (Flutter Web) echo -e "${GREEN}🎉 Synchronization complete!${NC}" echo "You can now verify the prototypes in internal/launchpad/prototypes/ and commit the changes."