Skip to content

Commit ca71645

Browse files
fix: build errors
1 parent ee55f0b commit ca71645

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

Sources/Swiftly/Swiftly.swift

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,15 @@ extension SwiftlyCommand {
108108
// Verify that the configuration exists and can be loaded
109109
_ = try await Config.load(ctx)
110110

111+
let shouldUpdateSwiftly: Bool
112+
if let swiftlyRelease = try? await ctx.httpClient.getCurrentSwiftlyRelease() {
113+
shouldUpdateSwiftly = try swiftlyRelease.swiftlyVersion > SwiftlyCore.version
114+
} else {
115+
shouldUpdateSwiftly = false
116+
}
117+
111118
return {
112-
if let swiftlyRelease = try? await ctx.httpClient.getCurrentSwiftlyRelease(),
113-
swiftlyRelease.swiftlyVersion > SwiftlyCore.version
114-
{
119+
if shouldUpdateSwiftly {
115120
let updateMessage = """
116121
-----------------------------
117122
A new release of swiftly is available.

0 commit comments

Comments
 (0)