Fix macOS cleanup script

This commit is contained in:
Micah Lee 2022-04-03 17:35:41 -07:00
parent 9b28a9393a
commit 49471a835a
No known key found for this signature in database
GPG Key ID: 403C2657CD994F73
2 changed files with 13 additions and 6 deletions

View File

@ -104,7 +104,7 @@ jobs:
command: |
cd ~\project\desktop
poetry run python .\setup-freeze.py build
poetry run python .\script\build-windows.py cleanup-build
poetry run python .\scripts\build-windows.py cleanup-build
- run:
name: Compress
command: |
@ -152,7 +152,7 @@ jobs:
command: |
cd ~\project\desktop
C:\Python-32bit\Scripts\poetry run python .\setup-freeze.py build
C:\Python-32bit\Scripts\poetry run python .\package\windows.py cleanup-build
C:\Python-32bit\Scripts\poetry run python .\scripts\build-windows.py cleanup-build
- run:
name: Compress
command: |
@ -201,7 +201,7 @@ jobs:
command: |
cd ~/project/desktop
poetry run python ./setup-freeze.py bdist_mac
poetry run python ./install/build-macos.py cleanup-build
poetry run python ./scripts/build-macos.py cleanup-build
- run:
name: Compress
command: zip -r ~/onionshare-macos.zip ~/project/desktop/build/OnionShare.app

View File

@ -142,9 +142,14 @@ def cleanup_build():
shutil.rmtree(
f"{app_path}/Contents/MacOS/lib/PySide2/Qt/lib/{framework}.framework"
)
print(
f"Deleted: {app_path}/Contents/MacOS/lib/PySide2/Qt/lib/{framework}.framework"
)
try:
os.remove(f"{app_path}/Contents/MacOS/lib/PySide2/{framework}.abi3.so")
os.remove(f"{app_path}/Contents/MacOS/lib/PySide2/{framework}.pyi")
print(f"Deleted: {app_path}/Contents/MacOS/lib/PySide2/{framework}.abi3.so")
print(f"Deleted: {app_path}/Contents/MacOS/lib/PySide2/{framework}.pyi")
except FileNotFoundError:
pass
@ -219,10 +224,12 @@ def cleanup_build():
f"{app_path}/Contents/Resources/lib/PySide2/rcc",
f"{app_path}/Contents/Resources/lib/PySide2/uic",
]:
if os.path.isdir(filename):
shutil.rmtree(filename)
elif os.path.isfile(filename):
if os.path.isfile(filename) or os.path.islink(filename):
os.remove(filename)
print(f"Deleted: {filename}")
elif os.path.isdir(filename):
shutil.rmtree(filename)
print(f"Deleted: {filename}")
else:
print(f"Cannot delete, filename not found: {filename}")