Commit 06b983ba authored by 邱阿朋's avatar 邱阿朋

build(bat): 优化构建脚本并添加版本号支持

- 添加版本号参数支持,默认版本为 1.0.0
- 在构建过程中输出版本号
- 使用版本号生成 exe 文件,便于区分不同版本
- 添加删除 .spec 文件的步骤,保持工作目录清洁
- 优化脚本结构,增加注释提高可读性
parent 6c33e140
@echo off
REM 设置默认版本号
set DEFAULT_VERSION=1.0.0
REM 检查是否传入了版本号
if "%1"=="" (
set VERSION=%DEFAULT_VERSION%
) else (
set VERSION=%1
)
echo version: %VERSION%
REM 安装依赖
pip.exe install -i https://mirrors.cloud.tencent.com/pypi/simple -r requirements.txt pip.exe install -i https://mirrors.cloud.tencent.com/pypi/simple -r requirements.txt
pyinstaller -F -n amazon_cmd.exe main.py
pyinstaller -F -n amazon_gui.exe --noconsole gui.py REM 使用版本号生成 exe 文件
pyinstaller -F -n amazon_cmd_%VERSION%.exe main.py
pyinstaller -F -n amazon_gui_%VERSION%.exe --noconsole gui.py
pyinstaller -F -n easy_gui.exe --noconsole easy.py pyinstaller -F -n easy_gui.exe --noconsole easy.py
del *.spec
\ No newline at end of file REM 删除生成的 .spec 文件
del *.spec
echo build success
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment