Skip to content

Commit

Permalink
fixed ubuntu issue
Browse files Browse the repository at this point in the history
  • Loading branch information
JaapWijnen committed Jul 6, 2020
1 parent 6a89c4a commit ef48f1d
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions Sources/DOT/Graph+Rendering.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,6 @@ extension Graph {
task.arguments = ["-T", format.rawValue]

let inputPipe = Pipe()
inputPipe.fileHandleForWriting.writeabilityHandler = { fileHandle in
fileHandle.write(encoded.data(using: .utf8)!)
inputPipe.fileHandleForWriting.closeFile()
}
task.standardInput = inputPipe

var data = Data()
Expand All @@ -65,9 +61,11 @@ extension Graph {
task.launch()
}

inputPipe.fileHandleForWriting.write(Data(encoded.utf8))
try inputPipe.fileHandleForWriting.close()

task.waitUntilExit()

return data
}
}

0 comments on commit ef48f1d

Please sign in to comment.