fix validate_for_chd check and unqouted log line

This commit is contained in:
Alex Meyer 2024-05-14 13:26:52 -04:00
parent 9057a57abe
commit 15657f396c

View file

@ -34,7 +34,7 @@ find_compatible_compression_format() {
local normalized_filename=$(echo "$1" | tr '[:upper:]' '[:lower:]') local normalized_filename=$(echo "$1" | tr '[:upper:]' '[:lower:]')
local system=$(echo "$1" | grep -oE "$roms_folder/[^/]+" | grep -oE "[^/]+$") local system=$(echo "$1" | grep -oE "$roms_folder/[^/]+" | grep -oE "[^/]+$")
if [[ $(validate_for_chd "$1") == "true" ]] && [[ $(sed -n '/^\[/{h;d};/\b'"$system"'\b/{g;s/\[\(.*\)\]/\1/p;q};' $compression_targets) == "chd" ]]; then if [[ $(validate_for_chd "$1") == *"true" ]] && [[ $(sed -n '/^\[/{h;d};/\b'"$system"'\b/{g;s/\[\(.*\)\]/\1/p;q};' $compression_targets) == "chd" ]]; then
echo "chd" echo "chd"
elif grep -qF ".${normalized_filename##*.}" $zip_compressable_extensions && [[ $(sed -n '/^\[/{h;d};/\b'"$system"'\b/{g;s/\[\(.*\)\]/\1/p;q};' $compression_targets) == "zip" ]]; then elif grep -qF ".${normalized_filename##*.}" $zip_compressable_extensions && [[ $(sed -n '/^\[/{h;d};/\b'"$system"'\b/{g;s/\[\(.*\)\]/\1/p;q};' $compression_targets) == "zip" ]]; then
echo "zip" echo "zip"
@ -66,7 +66,7 @@ validate_for_chd() {
log i "Validating .cue associated .bin files" log i "Validating .cue associated .bin files"
local cue_bin_files=$(grep -o -P "(?<=FILE \").*(?=\".*$)" "$file") local cue_bin_files=$(grep -o -P "(?<=FILE \").*(?=\".*$)" "$file")
log i "Associated bin files read:" log i "Associated bin files read:"
log i $(printf '%s\n' "$cue_bin_files") log i "$(printf '%s\n' "$cue_bin_files")"
if [[ ! -z "$cue_bin_files" ]]; then if [[ ! -z "$cue_bin_files" ]]; then
while IFS= read -r line while IFS= read -r line
do do