Skip to content

Commit

Permalink
Use FileHandle instead of io.swift. (#408)
Browse files Browse the repository at this point in the history
  • Loading branch information
mpetrov authored and MrMage committed Mar 21, 2019
1 parent 14734c7 commit 1d056f1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 67 deletions.
64 changes: 0 additions & 64 deletions Sources/protoc-gen-swiftgrpc/io.swift

This file was deleted.

5 changes: 2 additions & 3 deletions Sources/protoc-gen-swiftgrpc/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func main() throws {
var response = Google_Protobuf_Compiler_CodeGeneratorResponse()

// read plugin input
let rawRequest = try Stdin.readall()
let rawRequest = FileHandle.standardInput.readDataToEndOfFile()
let request = try Google_Protobuf_Compiler_CodeGeneratorRequest(serializedData: rawRequest)

let options = try GeneratorOptions(parameter: request.parameter)
Expand All @@ -116,8 +116,7 @@ func main() throws {
}

// return everything to the caller
let serializedResponse = try response.serializedData()
Stdout.write(bytes: serializedResponse)
FileHandle.standardOutput.write(try response.serializedData())
}

do {
Expand Down

0 comments on commit 1d056f1

Please sign in to comment.