mirror of
https://github.com/yeongpin/cursor-free-vip.git
synced 2025-08-03 04:57:36 +08:00
Update Build.py
This commit is contained in:
parent
ca93d966cf
commit
f358ee9aec
14
build.py
14
build.py
@ -76,15 +76,21 @@ def build():
|
|||||||
os_type = "windows" if os.name == "nt" else "mac"
|
os_type = "windows" if os.name == "nt" else "mac"
|
||||||
output_name = f"CursorFreeVIP_{version}_{os_type}"
|
output_name = f"CursorFreeVIP_{version}_{os_type}"
|
||||||
|
|
||||||
build_command = f'pyinstaller --clean --noconfirm build.spec'
|
# 根据操作系统类型设置不同的构建命令和输出路径
|
||||||
|
if os_type == "windows":
|
||||||
|
build_command = f'pyinstaller --clean --noconfirm build.spec'
|
||||||
|
output_path = os.path.join('dist', f'{output_name}.exe')
|
||||||
|
else:
|
||||||
|
build_command = f'pyinstaller --clean --noconfirm build.mac.spec' # 使用 mac 专用的 spec 文件
|
||||||
|
output_path = os.path.join('dist', output_name) # Mac 应用不需要扩展名
|
||||||
|
|
||||||
os.system(build_command)
|
os.system(build_command)
|
||||||
|
|
||||||
loading.stop()
|
loading.stop()
|
||||||
|
|
||||||
exe_path = os.path.join('dist', f'{output_name}.exe')
|
if os.path.exists(output_path):
|
||||||
if os.path.exists(exe_path):
|
|
||||||
print(f"\n\033[92m✅ 構建完成!")
|
print(f"\n\033[92m✅ 構建完成!")
|
||||||
print(f"📦 可執行文件位於: {exe_path}\033[0m")
|
print(f"📦 可執行文件位於: {output_path}\033[0m")
|
||||||
else:
|
else:
|
||||||
print("\n\033[91m❌ 構建失敗:未找到輸出文件\033[0m")
|
print("\n\033[91m❌ 構建失敗:未找到輸出文件\033[0m")
|
||||||
return False
|
return False
|
||||||
|
Loading…
x
Reference in New Issue
Block a user