|
7 | 7 | UnityHubProject, |
8 | 8 | UnityHubProjectsList, |
9 | 9 | UnityInstallations, |
10 | | - UnityEditorLanguages, |
11 | | - UnityModules, |
12 | 10 | } from "./types/unity.js"; |
13 | 11 | import { CommandOptions, CommandResult, executeCommand } from "./utils/commandExecutor.js"; |
14 | 12 | import { getUnityChangeset, UnityChangeset } from "unity-changeset"; |
@@ -219,24 +217,23 @@ class UnityHub { |
219 | 217 | public static async addModule( |
220 | 218 | editorVersion: string, |
221 | 219 | modules: ModuleId[], |
222 | | - childModules: boolean = false |
| 220 | + childModules: boolean = true |
223 | 221 | ): Promise<void> { |
224 | 222 | try { |
225 | 223 | console.debug(`Adding module ${modules} to Unity ${editorVersion}`); |
226 | 224 |
|
227 | 225 | const args = ["install-modules", "-v", editorVersion]; |
228 | 226 |
|
229 | 227 | if (modules.length > 0) { |
230 | | - args.push("--module"); |
231 | | - args.push(modules.join(" ")); |
| 228 | + args.push(...["--module", modules.join(" ")]); |
| 229 | + |
| 230 | + if (childModules) { |
| 231 | + args.push("--child-modules"); |
| 232 | + } |
232 | 233 | } else { |
233 | 234 | throw new Error("No module IDs provided."); |
234 | 235 | } |
235 | 236 |
|
236 | | - if (childModules) { |
237 | | - args.push("--child-modules"); |
238 | | - } |
239 | | - |
240 | 237 | const { stdout, stderr } = await this.execUnityHubCommand(args, { |
241 | 238 | reject: false, |
242 | 239 | }); |
@@ -268,12 +265,10 @@ class UnityHub { |
268 | 265 | architecture: EditorArchitecture = EditorArchitecture.x86_64 |
269 | 266 | ): Promise<void> { |
270 | 267 | try { |
271 | | - const data: UnityChangeset = await getUnityChangeset(version); |
| 268 | + const data = await getUnityChangeset(version); |
272 | 269 | const args = ["install", "-v", version]; |
273 | 270 |
|
274 | | - if (data) { |
275 | | - args.push("--changeset", data.changeset); |
276 | | - } |
| 271 | + args.push("--changeset", data.changeset); |
277 | 272 |
|
278 | 273 | if (modules.length > 0) { |
279 | 274 | args.push("--module"); |
|
0 commit comments