Skip to content

Commit dd208e6

Browse files
committed
Call atrifacts download delegate method only if it ever try to download any artifact
1 parent ec407ac commit dd208e6

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Sources/Workspace/Workspace.swift

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1608,6 +1608,7 @@ extension Workspace {
16081608
let tempDiagnostics = DiagnosticsEngine()
16091609

16101610
var authProvider: AuthorizationProviding? = nil
1611+
var didDownloadAnyArtifact = false
16111612
#if os(macOS)
16121613
// Netrc feature currently only supported on macOS 10.13+ due to dependency
16131614
// on NSTextCheckingResult.range(with:)
@@ -1636,7 +1637,7 @@ extension Workspace {
16361637
}
16371638
let archivePath = parentDirectory.appending(component: parsedURL.lastPathComponent)
16381639

1639-
1640+
didDownloadAnyArtifact = true
16401641
downloader.downloadFile(
16411642
at: parsedURL,
16421643
to: archivePath,
@@ -1684,7 +1685,10 @@ extension Workspace {
16841685
}
16851686

16861687
group.wait()
1687-
delegate?.didDownloadBinaryArtifacts()
1688+
1689+
if didDownloadAnyArtifact {
1690+
delegate?.didDownloadBinaryArtifacts()
1691+
}
16881692

16891693
for diagnostic in tempDiagnostics.diagnostics {
16901694
diagnostics.emit(diagnostic.message, location: diagnostic.location)

0 commit comments

Comments
 (0)