Skip to content

Commit a0513bd

Browse files
committed
Clarified retrying
1 parent ef4002b commit a0513bd

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

scripts/unity-utils.ps1

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,14 @@ function RunUnity([string] $unityPath, [string[]] $arguments, [switch] $ReturnLo
6060
{
6161
Write-Host "::endgroup::"
6262
}
63-
if ($stdout -match "No valid Unity Editor license found. Please activate your license.")
63+
64+
$hasLicenseError = $stdout -match "No valid Unity Editor license found. Please activate your license."
65+
# In Unity 6.0, building on mobile with no license available errors with "unsuppored". Retrying works :)
66+
$hasUnsupportedTargetError = $stdout -match "Error building player because build target was unsupported"
67+
68+
if ($hasLicenseError -or $hasUnsupportedTargetError)
6469
{
65-
$msg = "Unity failed because it couldn't acquire a license."
70+
$msg = if ($hasLicenseError) { "Unity failed because it couldn't acquire a license." } else { "Unity failed because build target was unsupported." }
6671
$timeRemaining = $RunUnityLicenseRetryTimeoutSeconds - $stopwatchTotal.Elapsed.TotalSeconds
6772
$timeToSleep = $timeRemaining -gt $RunUnityLicenseRetryIntervalSeconds ? $RunUnityLicenseRetryIntervalSeconds : $timeRemaining - 1
6873
if ($timeToSleep -gt 0)

0 commit comments

Comments
 (0)