File tree Expand file tree Collapse file tree 2 files changed +3
-4
lines changed
Tools/build-swiftly-release Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -110,7 +110,7 @@ struct SwiftlyUserAgentMiddleware: ClientMiddleware {
110110
111111/// An `HTTPRequestExecutor` backed by a shared `HTTPClient`. This makes actual network requests.
112112public final class HTTPRequestExecutorImpl : HTTPRequestExecutor {
113- let httpClient : HTTPClient
113+ public let httpClient : HTTPClient
114114
115115 public init ( ) {
116116 var proxy : HTTPClient . Configuration . Proxy ?
Original file line number Diff line number Diff line change @@ -150,8 +150,9 @@ struct BuildSwiftlyRelease: AsyncParsableCommand {
150150 try ? await fs. remove ( atPath: libArchivePath)
151151
152152 // Download libarchive
153+ let httpExecutor = HTTPRequestExecutorImpl ( )
153154 let libarchiveRequest = HTTPClientRequest ( url: " https://github.com/libarchive/libarchive/releases/download/v \( libArchiveVersion) /libarchive- \( libArchiveVersion) .tar.gz " )
154- let libarchiveResponse = try await HTTPClient . shared . execute ( libarchiveRequest, timeout: . seconds( 60 ) )
155+ let libarchiveResponse = try await httpExecutor . httpClient . execute ( libarchiveRequest, timeout: . seconds( 60 ) )
155156 guard libarchiveResponse. status == . ok else {
156157 throw Error ( message: " Download failed with status: \( libarchiveResponse. status) " )
157158 }
@@ -180,8 +181,6 @@ struct BuildSwiftlyRelease: AsyncParsableCommand {
180181 }
181182
182183 let swiftVersion = swiftVerMatch. output. 1
183-
184- let httpExecutor = HTTPRequestExecutorImpl ( )
185184 guard let swiftRelease = ( try await httpExecutor. getReleaseToolchains ( ) ) . first ( where: { $0. name == swiftVersion } ) else {
186185 throw Error ( message: " Unable to find swift release using swift.org API: \( swiftVersion) " )
187186 }
You can’t perform that action at this time.
0 commit comments