Skip to content

Commit ca12050

Browse files
committed
fix(Hub): adjust in default params values
1 parent b51f00c commit ca12050

File tree

1 file changed

+8
-13
lines changed

1 file changed

+8
-13
lines changed

src/unityHub.ts

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ import {
77
UnityHubProject,
88
UnityHubProjectsList,
99
UnityInstallations,
10-
UnityEditorLanguages,
11-
UnityModules,
1210
} from "./types/unity.js";
1311
import { CommandOptions, CommandResult, executeCommand } from "./utils/commandExecutor.js";
1412
import { getUnityChangeset, UnityChangeset } from "unity-changeset";
@@ -219,24 +217,23 @@ class UnityHub {
219217
public static async addModule(
220218
editorVersion: string,
221219
modules: ModuleId[],
222-
childModules: boolean = false
220+
childModules: boolean = true
223221
): Promise<void> {
224222
try {
225223
console.debug(`Adding module ${modules} to Unity ${editorVersion}`);
226224

227225
const args = ["install-modules", "-v", editorVersion];
228226

229227
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+
}
232233
} else {
233234
throw new Error("No module IDs provided.");
234235
}
235236

236-
if (childModules) {
237-
args.push("--child-modules");
238-
}
239-
240237
const { stdout, stderr } = await this.execUnityHubCommand(args, {
241238
reject: false,
242239
});
@@ -268,12 +265,10 @@ class UnityHub {
268265
architecture: EditorArchitecture = EditorArchitecture.x86_64
269266
): Promise<void> {
270267
try {
271-
const data: UnityChangeset = await getUnityChangeset(version);
268+
const data = await getUnityChangeset(version);
272269
const args = ["install", "-v", version];
273270

274-
if (data) {
275-
args.push("--changeset", data.changeset);
276-
}
271+
args.push("--changeset", data.changeset);
277272

278273
if (modules.length > 0) {
279274
args.push("--module");

0 commit comments

Comments
 (0)