Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions vnext/Scripts/rnw-dependencies.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ $v = [System.Environment]::OSVersion.Version;
if ($env:Agent_BuildDirectory) {
$drive = (Resolve-Path $env:Agent_BuildDirectory).Drive
} else {
$drive = (Resolve-Path $PSCommandPath).Drive
if ($PSCommandPath) {
$drive = (Resolve-Path $PSCommandPath).Drive
} else {
$drive = (Resolve-Path $env:SystemDrive).Drive
}
}

function CheckVS {
Expand Down Expand Up @@ -122,9 +126,9 @@ if (!(IsElevated)) {
$NeedsRerun = $false
foreach ($req in $requirements)
{
Write-Output "Checking $($req.Name)";
Write-Host -NoNewline "Checking $($req.Name) ";
if (!($req.Valid)) {
Write-Output "Requirement failed: $($req.Name)";
Write-Host -ForegroundColor Red " Failed";
if ($req.Install) {
if ($Install -or (!$NoPrompt -and (Read-Host "Do you want to install? ").ToUpperInvariant() -eq 'Y')) {
Invoke-Command $req.Install -ErrorAction Stop
Expand All @@ -135,6 +139,8 @@ foreach ($req in $requirements)
} else {
$NeedsRerun = !($req.Optional);
}
} else {
Write-Host -ForegroundColor Green " OK";
}
}

Expand Down