Skip to content

Commit

Permalink
Fixed --reporter's output handling (previously parent directory was e…
Browse files Browse the repository at this point in the history
…xpected to exist) #97
  • Loading branch information
shyiko committed Oct 26, 2017
1 parent 2b45e22 commit eb75e26
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ktlint/src/main/kotlin/com/github/shyiko/ktlint/Main.kt
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ ${ByteArrayOutputStream().let { this.printUsage(it); it }.toString().trimEnd().s
System.err.println("[DEBUG] Initializing \"${r.id}\" reporter with ${r.config}" +
(r.output?.let { ", output=$it" } ?: ""))
}
val output = if (r.output != null) PrintStream(r.output) else
val output = if (r.output != null) { File(r.output).parentFile?.mkdirsOrFail(); PrintStream(r.output) } else
if (stdin) System.err else System.out
reporterProvider.get(output, r.config).let { reporter ->
if (r.output != null)
Expand Down

0 comments on commit eb75e26

Please sign in to comment.