#!/bin/bash

# 生产环境构建脚本

echo "Building Lunar Server..."

# 创建输出目录
mkdir -p bin

# 编译 Go 后端
echo "Building Go backend..."
go build -o bin/lunar-server cmd/main.go

# 编译前端（如果存在）
if [ -d "web" ]; then
    echo "Building frontend..."
    cd web
    npm install
    npm run build
    cd ..
fi

echo "Build complete!"
echo "Output: bin/lunar-server"
