Files
cutThenThink/build.sh
congsh 0ce1d71a90 build: 添加 Windows 打包方案
- 更新 PyInstaller spec 配置
- 简化 build.sh 构建脚本
- 更新 build.bat Windows 打包脚本
- 添加 docs/BUILD.md 打包说明文档

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 15:59:23 +08:00

47 lines
1.1 KiB
Bash
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/bash
# CutThenThink 极简版本打包脚本
set -e
echo "==================================="
echo "CutThenThink v2.0 极简版构建"
echo "==================================="
echo ""
echo "特点:"
echo "- 核心依赖PyQt6, requests, Pillow"
echo "- 可选 OCRRapidOCR 插件"
echo "- 无重型依赖torch, transformers, paddleocr"
echo "==================================="
# 检测 Python
PYTHON="python3"
if ! command -v python3 &>/dev/null; then
PYTHON="python"
fi
PIP="$PYTHON -m pip"
echo ""
echo "[1/5] 清理旧的构建..."
rm -rf build dist
echo ""
echo "[2/5] 安装构建依赖..."
$PIP install --user pyinstaller 2>/dev/null || echo " PyInstaller 已安装"
echo ""
echo "[3/5] 构建可执行文件..."
$PYTHON -m PyInstaller CutThenThink.spec --clean
echo ""
echo "==================================="
echo "构建完成!"
echo ""
echo "输出位置:"
echo " - dist/CutThenThink/ # 可执行文件"
echo ""
echo "首次运行前请配置:"
echo " 1. 可选安装 OCRpip install -r requirements-ocr.txt"
echo " 2. 配置文件:~/.cutthenthink/config.yaml"
echo "==================================="