#!/bin/bash
# 消费者端小程序构建脚本 (Linux/Mac)

echo "========================================"
echo "消费者端小程序构建脚本"
echo "========================================"
echo ""

echo "[1/3] 备份原配置文件..."
if [ -f "manifest.json" ]; then
    cp manifest.json manifest.json.bak
    echo "    已备份 manifest.json -> manifest.json.bak"
fi
echo ""

echo "[2/3] 应用消费者端配置文件..."
cp config/consumer/manifest.json manifest.json
echo "    已复制 config/consumer/manifest.json -> manifest.json"
npm run pages:consumer
echo ""

echo "[3/3] 配置完成！"
echo ""
echo "========================================"
echo "现在可以在 HBuilderX 中编译小程序了"
echo "编译目标: 微信小程序"
echo "========================================"
echo ""
echo "提示: 编译完成后，运行 restore-config.sh 恢复原配置"
echo ""
