diff options
| author | Alexander Karatarakis <alkarata@microsoft.com> | 2018-02-28 18:51:25 -0800 |
|---|---|---|
| committer | Alexander Karatarakis <alkarata@microsoft.com> | 2018-02-28 18:51:25 -0800 |
| commit | bbe0aa9230ffa919bec4c3e2b8f51acf4ac052b7 (patch) | |
| tree | 84e424550d5c55eea2453d7e31f81c8200c07c87 /scripts/fetchTool.ps1 | |
| parent | 2d2ff28c772a78fa76a656f1a66e04eeea9c879f (diff) | |
| download | vcpkg-bbe0aa9230ffa919bec4c3e2b8f51acf4ac052b7.tar.gz vcpkg-bbe0aa9230ffa919bec4c3e2b8f51acf4ac052b7.zip | |
[fetchTool.ps1] Set-StrictMode to Latest
Diffstat (limited to 'scripts/fetchTool.ps1')
| -rw-r--r-- | scripts/fetchTool.ps1 | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/scripts/fetchTool.ps1 b/scripts/fetchTool.ps1 index 1f72bb39e..2c2f599ef 100644 --- a/scripts/fetchTool.ps1 +++ b/scripts/fetchTool.ps1 @@ -3,6 +3,7 @@ param( [Parameter(Mandatory=$true)][string]$tool ) +Set-StrictMode -Version Latest $scriptsDir = split-path -parent $script:MyInvocation.MyCommand.Definition . "$scriptsDir\VcpkgPowershellUtils.ps1" @@ -31,7 +32,8 @@ function fetchToolInternal([Parameter(Mandatory=$true)][string]$tool) return $exePath } - if ($toolData.archiveRelativePath) + $isArchive = vcpkgHasProperty -object $toolData -propertyName "archiveRelativePath" + if ($isArchive) { $downloadPath = "$downloadsDir\$($toolData.archiveRelativePath)" } @@ -52,7 +54,7 @@ function fetchToolInternal([Parameter(Mandatory=$true)][string]$tool) $downloadedFileHash = vcpkgGetSHA256 $downloadPath vcpkgCheckEqualFileHash -filePath $downloadPath -expectedHash $expectedDownloadedFileHash -actualHash $downloadedFileHash - if ($toolData.archiveRelativePath) + if ($isArchive) { $outFilename = (Get-ChildItem $downloadPath).BaseName Write-Host "Extracting $tool..." |
