Fix compressed file detection for removal validation

This commit is contained in:
icenine451 2024-06-27 08:52:41 -04:00
parent 8deda02343
commit d08d027db6

View file

@ -28,7 +28,7 @@ compress_game() {
fi fi
if [[ $post_compression_cleanup == "true" ]]; then # Remove file(s) if requested if [[ $post_compression_cleanup == "true" ]]; then # Remove file(s) if requested
if [[ -f "${file%.*}.$compatible_compression_format" ]]; then if [[ -f "${file%.*}.$1" ]]; then
log i "Performing post-compression file cleanup" log i "Performing post-compression file cleanup"
if [[ "$file" == *".cue" ]]; then if [[ "$file" == *".cue" ]]; then
local cue_bin_files=$(grep -o -P "(?<=FILE \").*(?=\".*$)" "$file") local cue_bin_files=$(grep -o -P "(?<=FILE \").*(?=\".*$)" "$file")
@ -45,7 +45,7 @@ compress_game() {
rm -f "$(realpath "$file")" rm -f "$(realpath "$file")"
fi fi
else else
log i "Compressed file ${file%.*}.$compatible_compression_format not found, skipping original file deletion" log i "Compressed file ${file%.*}.$1 not found, skipping original file deletion"
fi fi
fi fi
} }