Skip to content

Commit b09a405

Browse files
committed
Reduce stack of simple code
1 parent 9071cec commit b09a405

File tree

1 file changed

+7
-37
lines changed

1 file changed

+7
-37
lines changed

UnitySetup/UnitySetup.psm1

Lines changed: 7 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -280,43 +280,13 @@ function Start-UnityEditor
280280

281281
$editor = Get-ChildItem "$unityPath" -Filter Unity.exe -Recurse | Select-Object -First 1 -ExpandProperty FullName
282282

283-
$args = @()
284-
$args += "-projectPath"
285-
$args += $ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath($Project)
286-
287-
if( $ExecuteMethod )
288-
{
289-
$args += "-executeMethod"
290-
$args += $ExecuteMethod
291-
}
292-
293-
if( $OutputPath )
294-
{
295-
$args += "-buildOutput"
296-
$args += $OutputPath
297-
}
298-
299-
if( $LogFile )
300-
{
301-
$args += "-logFile"
302-
$args += $LogFile
303-
}
304-
305-
if( $BuildTarget )
306-
{
307-
$args += "-buildTarget"
308-
$args += $BuildTarget
309-
}
310-
311-
if( $BatchMode )
312-
{
313-
$args += "-batchmode"
314-
}
315-
316-
if( $Quit )
317-
{
318-
$args += "-quit"
319-
}
283+
$args = "-projectPath", $ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath($Project)
284+
if( $ExecuteMethod ) { $args += "-executeMethod", $ExecuteMethod }
285+
if( $OutputPath ) { $args += "-buildOutput", $OutputPath }
286+
if( $LogFile ) { $args += "-logFile", $LogFile }
287+
if( $BuildTarget ) { $args += "-buildTarget", $BuildTarget }
288+
if( $BatchMode ) { $args += "-batchmode" }
289+
if( $Quit ) { $args += "-quit" }
320290

321291
Write-Host "$editor $args" -ForegroundColor Green
322292
$process = Start-Process -FilePath $editor -ArgumentList $args -PassThru -ErrorAction Stop

0 commit comments

Comments
 (0)