This repository was archived by the owner on Aug 11, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +6
-10
lines changed Expand file tree Collapse file tree 2 files changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -344,15 +344,12 @@ function Run-As {
344
344
$psi.Arguments = $arguments ;
345
345
$psi.CreateNoWindow = $true ;
346
346
$psi.RedirectStandardInput = $true ;
347
- $psi.RedirectStandardOutput = $true ;
348
347
$p = [System.Diagnostics.Process ]::Start($psi );
348
+ $p.StandardInput.WriteLine (" y" );
349
349
while (-not $p.HasExited ) {
350
- $line = $p.StandardOutput.ReadLine ()
351
- Write-Host $line
352
350
if ($line -match ' y/N' ) {
353
351
$p.StandardInput.WriteLine (" y" );
354
352
}
355
- # sleep for a ms
356
353
Start-Sleep - Milliseconds 1
357
354
}
358
355
@@ -385,7 +382,8 @@ if ($modules -contains 'android') {
385
382
exit 1
386
383
}
387
384
Write-Host " Accepting Android SDK Licenses"
388
- Run- As - command " $androidSdkManagerPath " - arguments " --licenses"
385
+ # run sdkmanager --licenses and redirect input to accept all licenses by sending 'y' to stdin
386
+
389
387
Write-Host " Updating Android SDK"
390
388
Run- As - command " $androidSdkManagerPath " - arguments " --update"
391
389
$projectSettingsPath = $env: UNITY_PROJECT_PATH + " /ProjectSettings/ProjectSettings.asset"
Original file line number Diff line number Diff line change @@ -344,15 +344,12 @@ function Run-As {
344
344
$psi.Arguments = $arguments ;
345
345
$psi.CreateNoWindow = $true ;
346
346
$psi.RedirectStandardInput = $true ;
347
- $psi.RedirectStandardOutput = $true ;
348
347
$p = [System.Diagnostics.Process ]::Start($psi );
348
+ $p.StandardInput.WriteLine (" y" );
349
349
while (-not $p.HasExited ) {
350
- $line = $p.StandardOutput.ReadLine ()
351
- Write-Host $line
352
350
if ($line -match ' y/N' ) {
353
351
$p.StandardInput.WriteLine (" y" );
354
352
}
355
- # sleep for a ms
356
353
Start-Sleep - Milliseconds 1
357
354
}
358
355
@@ -385,7 +382,8 @@ if ($modules -contains 'android') {
385
382
exit 1
386
383
}
387
384
Write-Host " Accepting Android SDK Licenses"
388
- Run- As - command " $androidSdkManagerPath " - arguments " --licenses"
385
+ # run sdkmanager --licenses and redirect input to accept all licenses by sending 'y' to stdin
386
+
389
387
Write-Host " Updating Android SDK"
390
388
Run- As - command " $androidSdkManagerPath " - arguments " --update"
391
389
$projectSettingsPath = $env: UNITY_PROJECT_PATH + " /ProjectSettings/ProjectSettings.asset"
You can’t perform that action at this time.
0 commit comments