Overwrite files from previous shrink failure

This commit is contained in:
prpr 2023-06-06 01:48:53 +01:00
parent d3f83f6f42
commit 1def3cc520

View File

@ -77,7 +77,7 @@ proc ::shrink::dequeue {q ts} {
# Move the shrunken version back to the local directory. # Move the shrunken version back to the local directory.
foreach f [glob "$tmp/shrunk.*"] { foreach f [glob "$tmp/shrunk.*"] {
set ext [file extension $f] set ext [file extension $f]
file rename $f "${file}_shrunk${ext}" file rename -force $f "${file}_shrunk${ext}"
# Set the file time to match the old file # Set the file time to match the old file
file touch "${file}_shrunk${ext}" [$ts get file] file touch "${file}_shrunk${ext}" [$ts get file]
} }
@ -93,7 +93,7 @@ proc ::shrink::dequeue {q ts} {
foreach ext $tsgroup { foreach ext $tsgroup {
set f "${file}_shrunk.$ext" set f "${file}_shrunk.$ext"
if {[file exists $f]} { if {[file exists $f]} {
file rename $f "${file}.$ext" file rename -force $f "${file}.$ext"
} }
} }
$ts set_shrunk $ts set_shrunk