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

Commit

Permalink
Correctly handle directory creation
Browse files Browse the repository at this point in the history
  • Loading branch information
esotericenderman committed Sep 10, 2024
1 parent af34de3 commit f6f19dc
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,10 @@ fun moveFilesRecursively(sourceDir: File, destDir: File) {
println()

try {
if (sourceFile.isDirectory) {
if (!destFile.exists()) {
destFile.mkdirs()
println("Created directory $destFile")
}
} else {
Files.move(sourceFile.toPath(), destFile.toPath())
println("Moved file ${sourceFile.path} to $destFile")
}
sourceFile.mkdirs()

Files.move(sourceFile.toPath(), destFile.toPath())
println("Moved file ${sourceFile.path} to $destFile")
} catch (e: Exception) {
throw RuntimeException(e)
}
Expand Down

0 comments on commit f6f19dc

Please sign in to comment.