Skip to content

Commit

Permalink
Revert unnecessary command behavior change (#197)
Browse files Browse the repository at this point in the history
Revert this unnecessary and ill-advised behavior change.
  • Loading branch information
gwynne committed Jan 10, 2024
1 parent a7dd700 commit a31f44e
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Sources/ConsoleKitCommands/Base/AnyCommand.swift
Expand Up @@ -25,9 +25,12 @@ extension AnyCommand {
""
}

// we need to have a sync environment so the compiler uses the sync run method over the async version
private func syncRun(using context: inout CommandContext) throws {
try self.run(using: &context)
}

public func run(using context: inout CommandContext) async throws {
try await withCheckedThrowingContinuation { continuation in
continuation.resume(with: .init { try self.run(using: &context) })
}
try self.syncRun(using: &context)
}
}

0 comments on commit a31f44e

Please sign in to comment.