Skip to content

Commit 7a446a0

Browse files
committed
detect Unity license error
1 parent c492a49 commit 7a446a0

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

UnitySetup/UnitySetup.psm1

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -981,6 +981,7 @@ function Start-UnityEditor {
981981
# Open the specified Unity log file and write any errors found in the file to the error stream.
982982
function Write-UnityErrors {
983983
param([string] $LogFileName)
984+
Write-Verbose "Checking $LogFileName for errors"
984985
$errors = Get-Content $LogFileName | Where-Object { Get-IsUnityError $_ }
985986
if ( $errors.Count -gt 0 ) {
986987
$errorMessage = $errors -join "`r`n"
@@ -992,6 +993,12 @@ function Write-UnityErrors {
992993
function Get-IsUnityError {
993994
param([string] $LogLine)
994995

996+
# Detect Unity License error, for example:
997+
# BatchMode: Unity has not been activated with a valid License. Could be a new activation or renewal...
998+
if ( $LogLine -match 'Unity has not been activated with a valid License' ) {
999+
return $true
1000+
}
1001+
9951002
# Detect compilation error, for example:
9961003
# Assets/Errors.cs(7,9): error CS0103: The name `NonexistentFunction' does not exist in the current context
9971004
if ( $LogLine -match '\.cs\(\d+,\d+\): error ' ) {

0 commit comments

Comments
 (0)