Skip to content

Commit 3891302

Browse files
giacomocavalierinicolasfara
authored andcommitted
fix: create target directory if it does not exist when serializing a table
1 parent 4903a2b commit 3891302

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/scala/dev/atedeg/Table.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ final case class Table(title: String, columnsName: List[String], rows: List[Row]
2121

2222
def serialize(targetDir: File): Try[Unit] = {
2323
val file = targetDir / s"$title.md"
24-
Try(file < this.toString)
24+
Try(file.createFileIfNotExists(true).write(this.toString))
2525
}
2626
}
2727

0 commit comments

Comments
 (0)