forked from neuroinformatics-unit/datashuttle
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpackage_macos.py
More file actions
52 lines (40 loc) · 1.46 KB
/
Copy pathpackage_macos.py
File metadata and controls
52 lines (40 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import shutil
import subprocess
from pathlib import Path
import packaging_utils
WEZTERM_VERSION = packaging_utils.get_wezterm_version()
WEZTERM_FOLDERNAME = f"WezTerm-macos-{WEZTERM_VERSION}"
WEZTERM_URL = f"https://github.com/wezterm/wezterm/releases/download/{WEZTERM_VERSION}/{WEZTERM_FOLDERNAME}.zip"
# Paths
project_root = Path(__file__).parent
vendored_dir = project_root / "_vendored"
if not (vendored_dir / WEZTERM_FOLDERNAME).exists():
packaging_utils.download_wezterm(vendored_dir, WEZTERM_FOLDERNAME)
if (build_path := project_root / "build").exists():
shutil.rmtree(build_path)
if (dist_path := project_root / "dist").exists():
shutil.rmtree(dist_path)
# Step 2: Run PyInstaller builds
subprocess.run(f"pyinstaller {project_root / 'datashuttle.spec'}", shell=True)
subprocess.run(
f"pyinstaller {project_root / 'terminal_launcher_macos.spec'}", shell=True
)
app_macos_path = (
project_root / "dist" / "Datashuttle.app" / "Contents" / "Resources"
)
shutil.copytree(
vendored_dir / f"{WEZTERM_FOLDERNAME}",
app_macos_path / "_vendored" / f"{WEZTERM_FOLDERNAME}",
)
shutil.copytree(
project_root / "dist" / "datashuttle" / "_internal",
app_macos_path.parent / "Resources" / "_internal",
)
shutil.copy(
project_root / "dist" / "datashuttle" / "datashuttle",
app_macos_path.parent / "Resources",
)
shutil.copy(
project_root / "wezterm_config.lua",
app_macos_path.parent / "Resources" / "_vendored" / WEZTERM_FOLDERNAME,
)