MCPcopy Create free account
hub / github.com/bigdra50/unity-cli / _get_platform_hub_candidates

Function _get_platform_hub_candidates

unity_cli/hub/paths.py:29–52  ·  view source on GitHub ↗

Platform-specific Hub CLI locations (ordered by priority).

()

Source from the content-addressed store, hash-verified

27
28
29def _get_platform_hub_candidates() -> list[Path]:
30 """Platform-specific Hub CLI locations (ordered by priority)."""
31 if sys.platform == "darwin":
32 return [
33 Path("/Applications/Unity Hub.app/Contents/MacOS/Unity Hub"),
34 Path.home() / "Applications/Unity Hub.app/Contents/MacOS/Unity Hub",
35 ]
36 elif sys.platform == "win32":
37 localappdata = os.environ.get("LOCALAPPDATA", "")
38 programfiles_x86 = os.environ.get("ProgramFiles(x86)", "") # noqa: SIM112
39 candidates = [
40 Path(r"C:\Program Files\Unity Hub\Unity Hub.exe"),
41 ]
42 if programfiles_x86:
43 candidates.append(Path(programfiles_x86) / "Unity Hub" / "Unity Hub.exe")
44 if localappdata:
45 candidates.append(Path(localappdata) / "Programs" / "Unity Hub" / "Unity Hub.exe")
46 return candidates
47 else: # Linux
48 return [
49 Path("/opt/unityhub/unityhub"),
50 Path.home() / "Unity/Hub/UnityHub.AppImage",
51 Path.home() / ".local/share/applications/unityhub.AppImage",
52 ]
53
54
55def _get_platform_editor_base() -> Path:

Callers 1

locate_hub_cliFunction · 0.85

Calls 1

getMethod · 0.45

Tested by

no test coverage detected