diff --git a/src/main/groovy/com/selesse/gradle/git/changelog/tasks/GenerateChangelogTask.groovy b/src/main/groovy/com/selesse/gradle/git/changelog/tasks/GenerateChangelogTask.groovy index ec61960..b956498 100644 --- a/src/main/groovy/com/selesse/gradle/git/changelog/tasks/GenerateChangelogTask.groovy +++ b/src/main/groovy/com/selesse/gradle/git/changelog/tasks/GenerateChangelogTask.groovy @@ -54,7 +54,10 @@ class GenerateChangelogTask extends DefaultTask { getOutputDirectory().mkdirs() def changelogFile = getOutputFile(format) - changelogWriter.writeChangelog(new PrintStream(new FileOutputStream(changelogFile))) + + def fileOutputStream = new FileOutputStream(changelogFile) + changelogWriter.writeChangelog(new PrintStream(fileOutputStream)) + fileOutputStream.close() } }