Skip to content

Commit 38e1883

Browse files
committed
Merges in latest from upstream and resolves merge conflict with the default install path moved to Unity Hub's default install location.
2 parents 9fe346d + 46027e3 commit 38e1883

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

UnitySetup/UnitySetup.psm1

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -842,9 +842,15 @@ function Install-UnitySetupInstance {
842842

843843
if ( -not $PSBoundParameters.ContainsKey('BasePath') ) {
844844
$defaultInstallPath = switch ($currentOS) {
845-
([OperatingSystem]::Windows) { 'C:\Program Files\Unity' }
846-
([OperatingSystem]::Linux) { throw "Install-UnitySetupInstance has not been implemented on the Linux platform. Contributions welcomed!"; }
847-
([OperatingSystem]::Mac) { '/Applications/Unity' }
845+
([OperatingSystem]::Windows) {
846+
"C:\Program Files\Unity\Hub\Editor\"
847+
}
848+
([OperatingSystem]::Linux) {
849+
throw "Install-UnitySetupInstance has not been implemented on the Linux platform. Contributions welcomed!";
850+
}
851+
([OperatingSystem]::Mac) {
852+
"/Applications/Unity/Hub/Editor/"
853+
}
848854
}
849855
}
850856
else {
@@ -876,7 +882,7 @@ function Install-UnitySetupInstance {
876882
}
877883
}
878884
else {
879-
$installPath = "$defaultInstallPath-$installVersion"
885+
$installPath = [io.path]::Combine($defaultInstallPath, $installVersion)
880886
}
881887

882888
if ($currentOS -eq [OperatingSystem]::Mac) {
@@ -1405,7 +1411,7 @@ function Start-UnityEditor {
14051411
}
14061412

14071413
$projectPath = $ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath($($p.Path))
1408-
$instanceArgs += , ("-projectPath", $projectPath)
1414+
$instanceArgs += , ("-projectPath", "`"$projectPath`"")
14091415
$setupInstances += , $setupInstance
14101416
}
14111417

@@ -1497,7 +1503,7 @@ function Write-UnityErrors {
14971503
Write-Verbose "Checking $LogFileName for errors"
14981504
$errors = Get-Content $LogFileName | Where-Object { Get-IsUnityError $_ }
14991505
if ( $errors.Count -gt 0 ) {
1500-
$errors = $errors | select -uniq # Unity prints out errors as they occur and also in a summary list. We only want to see each unique error once.
1506+
$errors = $errors | Select-Object -uniq # Unity prints out errors as they occur and also in a summary list. We only want to see each unique error once.
15011507
$errorMessage = $errors -join "`r`n"
15021508
$errorMessage = "Errors were found in $LogFileName`:`r`n$errorMessage"
15031509
Write-Error $errorMessage

0 commit comments

Comments
 (0)