#!/bin/bash # Display welcome message echo "===================================================" echo "Mycelium Society Website - Build Script" echo "===================================================" echo "This script will build the production version of the Mycelium Society website." echo "" # Check if pnpm is installed if ! command -v pnpm &> /dev/null; then echo "pnpm is not installed. Please run ./install.sh first." exit 1 fi # Check if node_modules exists if [ ! -d "node_modules" ]; then echo "Dependencies not installed. Running installation script..." ./install.sh if [ $? -ne 0 ]; then echo "Installation failed. Please check the error messages above." exit 1 fi fi # Build the project echo "Building the project for production..." pnpm run build if [ $? -ne 0 ]; then echo "Build failed. Please check the error messages above." exit 1 fi echo "" echo "===================================================" echo "Build completed successfully!" echo "The production files are available in the 'dist' directory." echo "To serve the production build locally, run: ./serve.sh" echo "==================================================="