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

Function get_installed_editors

unity_cli/hub/paths.py:113–139  ·  view source on GitHub ↗

List installed Unity editors from filesystem. Scans the editor installation directory for valid Unity installations.

()

Source from the content-addressed store, hash-verified

111
112
113def get_installed_editors() -> list[InstalledEditor]:
114 """List installed Unity editors from filesystem.
115
116 Scans the editor installation directory for valid Unity installations.
117 """
118 paths = get_platform_paths()
119 editors: list[InstalledEditor] = []
120
121 if not paths.editor_base.exists():
122 return editors
123
124 for version_dir in paths.editor_base.iterdir():
125 if not version_dir.is_dir():
126 continue
127
128 binary_path = _get_editor_binary_path(paths.editor_base, version_dir.name)
129 if binary_path.exists():
130 editors.append(
131 InstalledEditor(
132 version=version_dir.name,
133 path=binary_path,
134 )
135 )
136
137 # Sort by version (newest first, simple string sort)
138 editors.sort(key=lambda e: e.version, reverse=True)
139 return editors
140
141
142def find_editor_by_version(version: str) -> InstalledEditor | None:

Callers 4

editor_listFunction · 0.90
resolve_editorMethod · 0.90
find_editor_by_versionFunction · 0.85

Calls 3

get_platform_pathsFunction · 0.85
_get_editor_binary_pathFunction · 0.85
InstalledEditorClass · 0.85

Tested by

no test coverage detected