mirror of
https://github.com/game-ci/unity-builder.git
synced 2025-07-04 12:25:19 -04:00
Fix powershell quotation issue, when CUSTOM_PARAMETERS contains spaces (#470)
This commit is contained in:
parent
4cb3e593f5
commit
96555a0945
6
dist/platforms/windows/build.ps1
vendored
6
dist/platforms/windows/build.ps1
vendored
@ -109,6 +109,10 @@ Write-Output "# Building project #"
|
|||||||
Write-Output "###########################"
|
Write-Output "###########################"
|
||||||
Write-Output ""
|
Write-Output ""
|
||||||
|
|
||||||
|
# If $Env:CUSTOM_PARAMETERS contains spaces and is passed directly on the command line to Unity, powershell will wrap it
|
||||||
|
# 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)
|
||||||
|
|
||||||
& "C:\Program Files\Unity\Hub\Editor\$Env:UNITY_VERSION\Editor\Unity.exe" -quit -batchmode -nographics `
|
& "C:\Program Files\Unity\Hub\Editor\$Env:UNITY_VERSION\Editor\Unity.exe" -quit -batchmode -nographics `
|
||||||
-projectPath $Env:UNITY_PROJECT_PATH `
|
-projectPath $Env:UNITY_PROJECT_PATH `
|
||||||
-executeMethod $Env:BUILD_METHOD `
|
-executeMethod $Env:BUILD_METHOD `
|
||||||
@ -122,7 +126,7 @@ Write-Output ""
|
|||||||
-androidKeyaliasName $Env:ANDROID_KEYALIAS_NAME `
|
-androidKeyaliasName $Env:ANDROID_KEYALIAS_NAME `
|
||||||
-androidKeyaliasPass $Env:ANDROID_KEYALIAS_PASS `
|
-androidKeyaliasPass $Env:ANDROID_KEYALIAS_PASS `
|
||||||
-androidTargetSdkVersion $Env:ANDROID_TARGET_SDK_VERSION `
|
-androidTargetSdkVersion $Env:ANDROID_TARGET_SDK_VERSION `
|
||||||
$Env:CUSTOM_PARAMETERS `
|
$customParametersArray `
|
||||||
-logfile | Out-Host
|
-logfile | Out-Host
|
||||||
|
|
||||||
# Catch exit code
|
# Catch exit code
|
||||||
|
Loading…
Reference in New Issue
Block a user