We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
PipeAsStringHandler
1 parent 47ca76b commit fbaa7ceCopy full SHA for fbaa7ce
Sources/SwiftExtensions/PipeAsStringHandler.swift
@@ -27,6 +27,14 @@ package actor PipeAsStringHandler {
27
self.handler = handler
28
}
29
30
+ deinit {
31
+ if !buffer.isEmpty {
32
+ queue.async { [handler, buffer] in
33
+ handler(String(data: buffer, encoding: .utf8) ?? "<invalid UTF-8>")
34
+ }
35
36
37
+
38
private func handleDataFromPipeImpl(_ newData: Data) {
39
self.buffer += newData
40
while let newlineIndex = self.buffer.firstIndex(of: UInt8(ascii: "\n")) {
0 commit comments