Skip to content

Commit

Permalink
fix(flat-file): Fix FileNotFound --release
Browse files Browse the repository at this point in the history
  • Loading branch information
nateweisz committed Feb 4, 2023
1 parent fd4616e commit f879ff8
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ class FlatFileConnection(val directory: String, val fileName: String) : Database
}

override fun createNewConnection(): File {
return File("$directory$fileName.json")
return File("$directory$fileName.json").apply {
if (!exists()) {
createNewFile()
}
}
}

override fun setConnection(connection: File) {
Expand Down

0 comments on commit f879ff8

Please sign in to comment.