[ps1] More fixes/tweaks

This commit is contained in:
Alexander Karatarakis 2018-03-27 04:08:57 -07:00
parent 7275877332
commit 72194ae8a0
2 changed files with 9 additions and 5 deletions

View File

@ -194,11 +194,14 @@ function vcpkgExtractFile( [Parameter(Mandatory=$true)][string]$archivePath,
}
}
$itemCount = @(Get-ChildItem "$destinationPartial").Count
$items = @(Get-ChildItem "$destinationPartial")
$itemCount = $items.Count
if ($itemCount -eq 1)
{
Move-Item -Path "$destinationPartial\*" -Destination $output
$item = $items | Select-Object -first 1
Write-Host "$item"
Move-Item -Path "$destinationPartial\$item" -Destination $output
vcpkgRemoveItem $destinationPartial
}
else

View File

@ -58,13 +58,14 @@ function fetchToolInternal([Parameter(Mandatory=$true)][string]$tool)
{
$outFilename = (Get-ChildItem $downloadPath).BaseName
Write-Host "Extracting $tool..."
vcpkgExtractFile -File $downloadPath -DestinationDir $downloadsDir -outFilename $outFilename
Write-Host "Extracting $tool has completed successfully."
vcpkgExtractFile -ArchivePath $downloadPath -DestinationDir $downloadsDir -outFilename $outFilename
Write-Host "Extracting $tool... done."
}
if (-not (Test-Path $exePath))
{
throw ("Could not detect or download " + $tool)
Write-Error "Could not detect or download $tool"
throw
}
return $exePath