Skip to content

Commit

Permalink
Add IO.blocking, rename file to match object in cli (#1322)
Browse files Browse the repository at this point in the history
  • Loading branch information
johnynek authored Dec 16, 2024
1 parent af05090 commit 2a61c63
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cli/src/main/scala/org/bykn/bosatsu/Main.scala
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ object Main extends IOApp {
case Right(getOutput) =>
PathModule.report(getOutput)
case Left(help) =>
IO {
IO.blocking {
System.err.println(help.toString)
ExitCode.Error
}
Original file line number Diff line number Diff line change
@@ -1450,7 +1450,7 @@ object ProtoConverter {
def read[A <: GeneratedMessage](
path: Path
)(implicit gmc: GeneratedMessageCompanion[A]): IO[A] =
IO {
IO.blocking {
val f = path.toFile
val ios = new BufferedInputStream(new FileInputStream(f))
try gmc.parseFrom(ios)
@@ -1460,7 +1460,7 @@ object ProtoConverter {
}

def write(a: GeneratedMessage, path: Path): IO[Unit] =
IO {
IO.blocking {
val f = path.toFile
val os = new BufferedOutputStream(new FileOutputStream(f))
try a.writeTo(os)
2 changes: 1 addition & 1 deletion cli/src/test/scala/org/bykn/bosatsu/TestProtoType.scala
Original file line number Diff line number Diff line change
@@ -55,7 +55,7 @@ class TestProtoType extends AnyFunSuite with ParTest {
}

def testWithTempFile(fn: Path => IO[Unit]): Unit = {
val tempRes = Resource.make(IO {
val tempRes = Resource.make(IO.blocking {
val f = File.createTempFile("proto_test", ".proto")
f.toPath
}) { path =>

0 comments on commit 2a61c63

Please sign in to comment.