Skip to content

Commit bea6318

Browse files
- hotfix unity hub installation check
1 parent 4c41b74 commit bea6318

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

.github/workflows/unity-build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ jobs:
4949
run: |
5050
unity-cli hub-install --hub-version 3.12.0
5151
unity-cli hub-install --auto-update
52+
unity-cli hub-version
5253
if [ "${{ matrix.unity-version }}" != "none" ]; then
5354
unity-cli setup-unity --unity-version "${{ matrix.unity-version }}" --build-targets "${{ matrix.build-target }}" --json
5455
fi

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@rage-against-the-pixel/unity-cli",
3-
"version": "1.6.0",
3+
"version": "1.6.1",
44
"description": "A command line utility for the Unity Game Engine.",
55
"author": "RageAgainstThePixel",
66
"license": "MIT",

src/unity-hub.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,15 +292,21 @@ export class UnityHub {
292292
}
293293

294294
let isInstalled = false;
295+
let installedVersion: SemVer | undefined = undefined;
296+
295297
try {
296298
await fs.promises.access(this.executable, fs.constants.X_OK);
299+
installedVersion = await this.getInstalledHubVersion();
297300
isInstalled = true;
298301
} catch {
299302
await this.installHub(version);
300303
}
301304

302305
if (isInstalled && autoUpdate) {
303-
const installedVersion: SemVer = await this.getInstalledHubVersion();
306+
if (!installedVersion) {
307+
installedVersion = await this.getInstalledHubVersion();
308+
}
309+
304310
this.logger.ci(`Installed Unity Hub version: ${installedVersion.version}`);
305311
let versionToInstall: SemVer | null = null;
306312

0 commit comments

Comments
 (0)