Skip to content

Commit 6c9369b

Browse files
committed
v1.0.3 Add Unity Hub lookup utility
1 parent aa142be commit 6c9369b

12 files changed

+837
-353
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [1.0.3]
9+
10+
### Added
11+
12+
- Unity Hub executable location path lookup utility
13+
814
## [1.0.2]
915

1016
### Changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2021 Dinomite Studios
3+
Copyright (c) 2021-2024 Dinomite
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) Dinomite Studios. All rights reserved.
1+
// Copyright (c) Dinomite. All rights reserved.
22
// Licensed under the MIT License. See LICENSE in the project root for license information.
33

44
export * from './lib/unity-log-streamer';

lib/models.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) Dinomite Studios. All rights reserved.
1+
// Copyright (c) Dinomite. All rights reserved.
22
// Licensed under the MIT License. See LICENSE in the project root for license information.
33

44
/**

lib/unity-log-streamer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) Dinomite Studios. All rights reserved.
1+
// Copyright (c) Dinomite. All rights reserved.
22
// Licensed under the MIT License. See LICENSE in the project root for license information.
33

44
import tail from 'tail';

lib/unity-path-tools.ts

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) Dinomite Studios. All rights reserved.
1+
// Copyright (c) Dinomite. All rights reserved.
22
// Licensed under the MIT License. See LICENSE in the project root for license information.
33

44
import { Utilities } from './utilities';
@@ -7,6 +7,21 @@ import path = require('path');
77

88
export class UnityPathTools {
99

10+
/**
11+
* Gets the path to the Unity Hub executable dependong on the build agent's operating system.
12+
* @returns
13+
*/
14+
public static getUnityHubPath(): string {
15+
const os = Utilities.getOS();
16+
17+
switch (os) {
18+
case OS.Windows: return path.join('C:', 'Program Files', 'Unity Hub', 'Unity Hub.exe');
19+
case OS.MacOS: return path.join('/', 'Applications', 'Unity Hub.app', 'Contents', 'MacOS', 'Unity Hub');
20+
case OS.Linux: return path.join('~', 'Unity Hub', 'Unity Hub');
21+
default: throw new Error('Operating system not supported!');
22+
}
23+
}
24+
1025
/**
1126
* Gets the path to the Unity editors folder depending on the process platform.
1227
* @param mode Path lookup mode: unityHub, environmentVariable or customUnityEditorsPath.

lib/unity-tool-runner.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) Dinomite Studios. All rights reserved.
1+
// Copyright (c) Dinomite. All rights reserved.
22
// Licensed under the MIT License. See LICENSE in the project root for license information.
33

44
import fs = require('fs-extra');

lib/unity-version-tools.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) Dinomite Studios. All rights reserved.
1+
// Copyright (c) Dinomite. All rights reserved.
22
// Licensed under the MIT License. See LICENSE in the project root for license information.
33

44
import { UnityVersionInfoResult } from './models';

lib/utilities.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) Dinomite Studios. All rights reserved.
1+
// Copyright (c) Dinomite. All rights reserved.
22
// Licensed under the MIT License. See LICENSE in the project root for license information.
33

44
import { OS } from "./models";

0 commit comments

Comments
 (0)