mirror of
git://code.qt.io/qt/qt5.git
synced 2026-03-17 17:56:11 +08:00
Make Copy-Item to throw exception if source does not exist
Copy-Item command does not throw by default. Thus, copying error is not caught and the Download function returns without downloading from the official site. Adding "-errorAction stop" makes Copy-Item to throw an exception as expected in the script. Change-Id: I889cccac775705613e641453aca9e0197645f344 Reviewed-by: Simo Fält <simo.falt@qt.io> Reviewed-by: Toni Saario <toni.saario@qt.io>
This commit is contained in:
@@ -148,7 +148,7 @@ function Download
|
||||
if ($CachedUrl.StartsWith("http")) {
|
||||
Invoke-WebRequest -UseBasicParsing $CachedUrl -OutFile $Destination
|
||||
} else {
|
||||
Copy-Item $CachedUrl $Destination
|
||||
Copy-Item $CachedUrl $Destination -errorAction stop
|
||||
}
|
||||
} catch {
|
||||
Write-Host "Cached download failed: Downloading from official location: $OfficialUrl"
|
||||
|
||||
Reference in New Issue
Block a user