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 {
110
110
111
111
/// An `HTTPRequestExecutor` backed by a shared `HTTPClient`. This makes actual network requests.
112
112
public final class HTTPRequestExecutorImpl : HTTPRequestExecutor {
113
- let httpClient : HTTPClient
113
+ public let httpClient : HTTPClient
114
114
115
115
public init ( ) {
116
116
var proxy : HTTPClient . Configuration . Proxy ?
Original file line number Diff line number Diff line change @@ -150,8 +150,9 @@ struct BuildSwiftlyRelease: AsyncParsableCommand {
150
150
try ? await fs. remove ( atPath: libArchivePath)
151
151
152
152
// Download libarchive
153
+ let httpExecutor = HTTPRequestExecutorImpl ( )
153
154
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 ) )
155
156
guard libarchiveResponse. status == . ok else {
156
157
throw Error ( message: " Download failed with status: \( libarchiveResponse. status) " )
157
158
}
@@ -180,8 +181,6 @@ struct BuildSwiftlyRelease: AsyncParsableCommand {
180
181
}
181
182
182
183
let swiftVersion = swiftVerMatch. output. 1
183
-
184
- let httpExecutor = HTTPRequestExecutorImpl ( )
185
184
guard let swiftRelease = ( try await httpExecutor. getReleaseToolchains ( ) ) . first ( where: { $0. name == swiftVersion } ) else {
186
185
throw Error ( message: " Unable to find swift release using swift.org API: \( swiftVersion) " )
187
186
}
You can’t perform that action at this time.
0 commit comments