Skip to content

Commit

Permalink
Create working dir if it's not existing (cortinico#230)
Browse files Browse the repository at this point in the history
* Create working dir if it's not existing

* Update CHANGELOG
  • Loading branch information
cortinico authored Dec 19, 2023
1 parent ca3ef2e commit cb0eece
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Please add your entries according to this format.

- Adapt the plugin to work with KSP 1.9.21
- Remove legacy `kotlin-compiler-embeddable` dependency to prevent potential Kotlin version conflicts
- Fix bug with Gradle Configuration Cache by always creating working dir if it's not existing
- Kotlin to 1.9.21

## Version 0.15.1 *(2023-10-31)*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,11 @@ internal abstract class KtfmtWorkAction : WorkAction<KtfmtWorkAction.KtfmtWorkPa
}

private fun writeResult(result: KtfmtResult) {
val resultFile = parameters.workingDir.asFile.get().resolve(UUID.randomUUID().toString())
val workingDir = parameters.workingDir.asFile.get()
if (!workingDir.exists()) {
workingDir.mkdirs()
}
val resultFile = workingDir.resolve(UUID.randomUUID().toString())
resultFile.writeText(result.toResultString())
}

Expand Down

0 comments on commit cb0eece

Please sign in to comment.