first commit: 初始化项目,添加基本功能和打包脚本
Some checks failed
Remove old artifacts / remove-old-artifacts (push) Has been cancelled
Some checks failed
Remove old artifacts / remove-old-artifacts (push) Has been cancelled
This commit is contained in:
61
build_mac.command
Normal file
61
build_mac.command
Normal file
@@ -0,0 +1,61 @@
|
||||
#!/bin/bash
|
||||
|
||||
# 获取脚本所在目录
|
||||
cd "$(dirname "$0")"
|
||||
|
||||
# 检查虚拟环境
|
||||
if [ -f "venv/bin/activate" ]; then
|
||||
echo "激活虚拟环境..."
|
||||
source venv/bin/activate
|
||||
else
|
||||
echo "警告: 未找到虚拟环境,创建新的虚拟环境..."
|
||||
python3 -m venv venv
|
||||
source venv/bin/activate
|
||||
|
||||
echo "安装依赖..."
|
||||
pip3 install --upgrade pip
|
||||
pip3 install pyinstaller
|
||||
pip3 install PyQt5
|
||||
pip3 install requests
|
||||
pip3 install urllib3
|
||||
fi
|
||||
|
||||
# 确保依赖已安装
|
||||
echo "检查依赖..."
|
||||
pip3 list | grep -E "pyinstaller|PyQt5|requests|urllib3" || {
|
||||
echo "安装缺失的依赖..."
|
||||
pip3 install pyinstaller PyQt5 requests urllib3
|
||||
}
|
||||
|
||||
# 执行打包
|
||||
echo "开始打包..."
|
||||
python3 -m PyInstaller \
|
||||
--name="听泉助手" \
|
||||
--windowed \
|
||||
--clean \
|
||||
--noconfirm \
|
||||
--add-data="logger.py:." \
|
||||
--add-data="update_cursor_token.py:." \
|
||||
--add-data="cursor_auth_manager.py:." \
|
||||
--add-data="reset_machine.py:." \
|
||||
--add-data="patch_cursor_get_machine_id.py:." \
|
||||
--add-data="exit_cursor.py:." \
|
||||
--add-data="go_cursor_help.py:." \
|
||||
--add-data="logo.py:." \
|
||||
--hidden-import=PyQt5 \
|
||||
--hidden-import=requests \
|
||||
--hidden-import=urllib3 \
|
||||
--target-architecture=universal2 \
|
||||
--codesign-identity=- \
|
||||
--osx-bundle-identifier=com.tingquan.helper \
|
||||
gui/main_window.py
|
||||
|
||||
# 检查打包结果
|
||||
if [ -d "dist/听泉助手.app" ]; then
|
||||
echo "打包成功!应用程序包已生成在 dist/听泉助手.app"
|
||||
else
|
||||
echo "打包失败,请检查错误信息"
|
||||
fi
|
||||
|
||||
# 退出虚拟环境
|
||||
deactivate
|
||||
Reference in New Issue
Block a user