Skip to content
This repository has been archived by the owner on Jan 29, 2025. It is now read-only.

Commit

Permalink
Improve logs
Browse files Browse the repository at this point in the history
  • Loading branch information
esotericenderman committed Sep 10, 2024
1 parent f6f19dc commit def7d49
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,12 @@ fun moveFilesRecursively(sourceDir: File, destDir: File) {
}

if (!destDir.exists()) {
destDir.mkdirs()
println("Created destination directory ${destDir.path}")
if (destDir.mkdirs()) {
println("Created destination directory ${destDir.path}")
} else {
println("FAILED to create destination directory ${destDir.path}")
return
}
}

sourceDir.walkTopDown().filter { it.isFile }.forEach { sourceFile ->
Expand All @@ -79,7 +83,10 @@ fun moveFilesRecursively(sourceDir: File, destDir: File) {
println()

try {
sourceFile.mkdirs()
if (sourceFile.mkdirs()) {
println("FAILED to create ${sourceFile.path}")
return
}

Files.move(sourceFile.toPath(), destFile.toPath())
println("Moved file ${sourceFile.path} to $destFile")
Expand Down

0 comments on commit def7d49

Please sign in to comment.