From 15657f396c09711bc9935009d9b2bbafc2e57a84 Mon Sep 17 00:00:00 2001 From: Alex Meyer Date: Tue, 14 May 2024 13:26:52 -0400 Subject: [PATCH] fix validate_for_chd check and unqouted log line --- functions/compression.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/functions/compression.sh b/functions/compression.sh index bb33cd2e..e2af3fe2 100644 --- a/functions/compression.sh +++ b/functions/compression.sh @@ -34,7 +34,7 @@ find_compatible_compression_format() { local normalized_filename=$(echo "$1" | tr '[:upper:]' '[:lower:]') 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" 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" @@ -66,7 +66,7 @@ validate_for_chd() { log i "Validating .cue associated .bin files" local cue_bin_files=$(grep -o -P "(?<=FILE \").*(?=\".*$)" "$file") 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 while IFS= read -r line do