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

Method install_editor

unity_cli/hub/hub_cli.py:112–148  ·  view source on GitHub ↗

Install editor version. Args: version: Unity version to install (e.g., "2022.3.10f1"). modules: Optional modules to install (e.g., ["ios", "android"]). changeset: Optional changeset for non-release versions. Returns: True if installat

(
        self,
        version: str,
        modules: list[str] | None = None,
        changeset: str | None = None,
    )

Source from the content-addressed store, hash-verified

110 return editors
111
112 def install_editor(
113 self,
114 version: str,
115 modules: list[str] | None = None,
116 changeset: str | None = None,
117 ) -> bool:
118 """Install editor version.
119
120 Args:
121 version: Unity version to install (e.g., "2022.3.10f1").
122 modules: Optional modules to install (e.g., ["ios", "android"]).
123 changeset: Optional changeset for non-release versions.
124
125 Returns:
126 True if installation succeeded.
127
128 Raises:
129 HubInstallError: If installation fails.
130 """
131 args = ["install", "-v", version]
132
133 if changeset:
134 args.extend(["-c", changeset])
135
136 if modules:
137 for module in modules:
138 args.extend(["-m", module])
139
140 result = self._run_command(args, timeout=3600.0) # 1 hour for install
141
142 if result.returncode != 0:
143 raise HubInstallError(
144 f"Failed to install Unity {version}: {result.stderr}",
145 code="HUB_INSTALL_FAILED",
146 )
147
148 return True
149
150 def install_modules(
151 self,

Callers 1

editor_installFunction · 0.95

Calls 2

_run_commandMethod · 0.95
HubInstallErrorClass · 0.90

Tested by

no test coverage detected