Skip to content

Commit b5e85bb

Browse files
Don't use global match
1 parent f9a98c2 commit b5e85bb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

UnitySetup/UnitySetup.psm1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ class UnitySetupInstance {
5555
$modules = (Get-Content "$path\modules.json" -Raw) | ConvertFrom-Json
5656

5757
foreach ( $module in $modules ) {
58-
$module.DownloadUrl -match "(\d+)\.(\d+)\.(\d+)([fpb])(\d+)" | Out-Null
58+
$match = $module.DownloadUrl -match "(\d+)\.(\d+)\.(\d+)([fpb])(\d+)" | Out-Null
5959

60-
if ( $Matches -ne $null ) {
61-
$this.Version = [UnityVersion]$Matches[0]
60+
if ( $null -ne $match ) {
61+
$this.Version = [UnityVersion]$match
6262
break
6363
}
6464
}

0 commit comments

Comments
 (0)