Skip to content

Commit 1e6ff27

Browse files
committed
fix(Hub): auto detect system arch when arg no passed
1 parent 3f4d93f commit 1e6ff27

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/unityHub.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
UnityInstallations,
1010
} from "./types/unity.js";
1111
import { CommandOptions, CommandResult, executeCommand } from "./utils/commandExecutor.js";
12-
import { getUnityChangeset, UnityChangeset } from "unity-changeset";
12+
import { getUnityChangeset } from "unity-changeset";
1313

1414
/**
1515
* Class for interacting with Unity Hub via command line interface
@@ -262,7 +262,9 @@ class UnityHub {
262262
public static async addEditor(
263263
version: string,
264264
modules: ModuleId[] = [],
265-
architecture: EditorArchitecture = EditorArchitecture.x86_64
265+
architecture: EditorArchitecture = process.platform === "darwin"
266+
? EditorArchitecture.arm64
267+
: EditorArchitecture.x86_64
266268
): Promise<void> {
267269
try {
268270
const data = await getUnityChangeset(version);
@@ -275,9 +277,7 @@ class UnityHub {
275277
args.push(modules.join(" "));
276278
}
277279

278-
if (this.platform === "darwin") {
279-
args.push("--architecture", architecture);
280-
}
280+
args.push("--architecture", architecture);
281281

282282
const { stdout, stderr } = await this.execUnityHubCommand(args, {
283283
reject: false,

0 commit comments

Comments
 (0)