Skip to content

Commit

Permalink
In debug mode, show update file system commands
Browse files Browse the repository at this point in the history
  • Loading branch information
ctrueden committed May 7, 2024
1 parent e9360f3 commit 07e49bc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/commonMain/kotlin/main.kt
Original file line number Diff line number Diff line change
Expand Up @@ -582,14 +582,18 @@ private fun applyUpdate(appDir: File, updateSubDir: File) {
for (file in updateSubDir.ls()) {
val dest = appDir / file.path.substring((appDir / "update").path.length)
if (file.isDirectory) {
debug("+ mkdir '$dest'")
dest.mkdir() || error("Couldn't create path $dest")
applyUpdate(appDir, file)
}
else {
if (file.length == 0L) {
debug("+ rm '$dest'")
dest.rm() || error("Couldn't remove $dest")
debug("+ rm '$file'")
file.rm() || error("Couldn't remove $file")
} else {
debug("+ mv '$file' '$dest'")
file.mv(dest) || error("Couldn't replace $dest")
}
}
Expand Down

0 comments on commit 07e49bc

Please sign in to comment.