diff --git a/Sources/ConsoleKitCommands/Base/AnyCommand.swift b/Sources/ConsoleKitCommands/Base/AnyCommand.swift index 9a26eb3..84ab2bb 100644 --- a/Sources/ConsoleKitCommands/Base/AnyCommand.swift +++ b/Sources/ConsoleKitCommands/Base/AnyCommand.swift @@ -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) } }