Fix null arg

This commit is contained in:
Andrew Kahr 2023-10-21 22:16:30 -07:00
parent 79c2e08314
commit 908b8afe33

View File

@ -133,7 +133,8 @@ Write-Output ""
# in double quotes. To avoid this, parse $Env:CUSTOM_PARAMETERS into an array, while respecting any quotations within the string. # in double quotes. To avoid this, parse $Env:CUSTOM_PARAMETERS into an array, while respecting any quotations within the string.
$_, $customParametersArray = Invoke-Expression('Write-Output -- "" ' + $Env:CUSTOM_PARAMETERS) | ForEach-Object { $_.ToString() } $_, $customParametersArray = Invoke-Expression('Write-Output -- "" ' + $Env:CUSTOM_PARAMETERS) | ForEach-Object { $_.ToString() }
$argList = @("-quit", $process = Start-Process -FilePath "C:\Program Files\Unity\Hub\Editor\$Env:UNITY_VERSION\Editor\Unity.exe" `
-ArgumentList @("-quit",
"-batchmode", "-batchmode",
"-nographics", "-nographics",
"-projectPath", $Env:UNITY_PROJECT_PATH, "-projectPath", $Env:UNITY_PROJECT_PATH,
@ -145,20 +146,12 @@ $argList = @("-quit",
"-androidVersionCode", $Env:ANDROID_VERSION_CODE, "-androidVersionCode", $Env:ANDROID_VERSION_CODE,
"-androidKeystorePass", $Env:ANDROID_KEYSTORE_PASS, "-androidKeystorePass", $Env:ANDROID_KEYSTORE_PASS,
"-androidKeyaliasName", $Env:ANDROID_KEYALIAS_NAME, "-androidKeyaliasName", $Env:ANDROID_KEYALIAS_NAME,
"-androidKeyaliasPass", $Env:ANDROID_KEYALIAS_PASS "-androidKeyaliasPass", $Env:ANDROID_KEYALIAS_PASS,
) # + $customParametersArray "-androidExportType", $Env:ANDROID_EXPORT_TYPE,
# , "-androidSymbolType", $Env:ANDROID_SYMBOL_TYPE,
# "-androidTargetSdkVersion", $Env:ANDROID_TARGET_SDK_VERSION, "-logfile", "-", "./build.log",
# "-androidExportType", $Env:ANDROID_EXPORT_TYPE, "-silent-crashes"
# "-androidSymbolType", $Env:ANDROID_SYMBOL_TYPE, ) + $customParametersArray `
# "-logfile", "-", "./build.log",
# "-silent-crashes"
foreach ($element in $argList) {
Write-Host $element
}
$process = Start-Process -FilePath "C:\Program Files\Unity\Hub\Editor\$Env:UNITY_VERSION\Editor\Unity.exe" `
-ArgumentList $argList `
-NoNewWindow ` -NoNewWindow `
-PassThru -PassThru