aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorAlexander Karatarakis <alkarata@microsoft.com>2018-04-08 15:12:19 -0700
committerAlexander Karatarakis <alkarata@microsoft.com>2018-04-08 15:14:21 -0700
commit1e1899c3a27f3816c39145049e2c33832071b8c6 (patch)
tree617c8a2083617bd6da621083cb7cbbe6533650f2 /scripts
parent43f6d73a6b2a50bbc9e72d2d9e7085bfe153296d (diff)
downloadvcpkg-1e1899c3a27f3816c39145049e2c33832071b8c6.tar.gz
vcpkg-1e1899c3a27f3816c39145049e2c33832071b8c6.zip
[ps1] Handle "downloading" local files
Fixes #3230
Diffstat (limited to 'scripts')
-rw-r--r--scripts/VcpkgPowershellUtils.ps16
1 files changed, 6 insertions, 0 deletions
diff --git a/scripts/VcpkgPowershellUtils.ps1 b/scripts/VcpkgPowershellUtils.ps1
index f6882409b..3ab301c55 100644
--- a/scripts/VcpkgPowershellUtils.ps1
+++ b/scripts/VcpkgPowershellUtils.ps1
@@ -166,6 +166,12 @@ function vcpkgDownloadFileWithAria2( [Parameter(Mandatory=$true)][string]$ari
$parentDir = split-path -parent $downloadPath
$filename = split-path -leaf $downloadPath
+ if ((Test-Path $url) -or ($url.StartsWith("file://"))) # if is local file
+ {
+ vcpkgDownloadFile $url $downloadPath $sha512
+ return
+ }
+
$ec = vcpkgInvokeCommand "$aria2exe" "--dir `"$parentDir`" --out `"$filename.part`" $url"
if ($ec -ne 0)
{