From bbe0aa9230ffa919bec4c3e2b8f51acf4ac052b7 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 28 Feb 2018 18:51:25 -0800 Subject: [fetchTool.ps1] Set-StrictMode to Latest --- scripts/fetchTool.ps1 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'scripts') 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..." -- cgit v1.2.3