#!/bin/bash
# 双击运行此脚本即可在 macOS 上构建 AI影视梦工厂 DMG 安装包

set -e

# 切换到脚本所在目录
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
cd "$SCRIPT_DIR"

# 检查构建脚本是否存在
if [ ! -f "build_macos.py" ]; then
    echo "❌ 错误：当前目录下未找到 build_macos.py"
    echo "请将此脚本放到 AI影视梦工厂 项目根目录后再运行。"
    read -p "按回车键退出..."
    exit 1
fi

# 检查 Python3
if ! command -v python3 &> /dev/null; then
    echo "❌ 错误：未找到 python3，请先安装 Python 3.10+"
    read -p "按回车键退出..."
    exit 1
fi

echo "🍎 开始在 macOS 上构建 AI影视梦工厂..."
python3 build_macos.py

read -p "按回车键退出..."
