diff --git a/app/services/whatsapp/baileys_handlers/helpers.rb b/app/services/whatsapp/baileys_handlers/helpers.rb index 425c3f089..e507d1c51 100644 --- a/app/services/whatsapp/baileys_handlers/helpers.rb +++ b/app/services/whatsapp/baileys_handlers/helpers.rb @@ -35,7 +35,7 @@ module Whatsapp::BaileysHandlers::Helpers # rubocop:disable Metrics/ModuleLength end end - def message_type # rubocop:disable Metrics/CyclomaticComplexity,Metrics/PerceivedComplexity,Metrics/MethodLength + def message_type # rubocop:disable Metrics/CyclomaticComplexity,Metrics/PerceivedComplexity,Metrics/MethodLength,Metrics/AbcSize msg = @raw_message[:message] if msg.key?(:conversation) || msg.dig(:extendedTextMessage, :text).present? 'text' diff --git a/deployment/extract_brand_assets.sh b/deployment/extract_brand_assets.sh index 5f118a794..99906a1ae 100755 --- a/deployment/extract_brand_assets.sh +++ b/deployment/extract_brand_assets.sh @@ -13,39 +13,6 @@ ZIP_FILE="$TEMP_DIR/downloaded_favicons.zip" EXTRACT_DIR="$TEMP_DIR/extracted_favicons" TARGET_DIR="public" -EXPECTED_FILES=" -android-icon-36x36.png -android-icon-48x48.png -android-icon-72x72.png -android-icon-96x96.png -android-icon-144x144.png -android-icon-192x192.png -apple-icon-57x57.png -apple-icon-60x60.png -apple-icon-72x72.png -apple-icon-76x76.png -apple-icon-114x114.png -apple-icon-120x120.png -apple-icon-144x144.png -apple-icon-152x152.png -apple-icon-180x180.png -apple-icon.png -apple-icon-precomposed.png -apple-touch-icon.png -apple-touch-icon-precomposed.png -favicon-16x16.png -favicon-32x32.png -favicon-96x96.png -favicon-512x512.png -favicon-badge-16x16.png -favicon-badge-32x32.png -favicon-badge-96x96.png -ms-icon-70x70.png -ms-icon-144x144.png -ms-icon-150x150.png -ms-icon-310x310.png -" - cleanup() { echo "Cleaning up temporary files..." rm -rf "$TEMP_DIR" @@ -71,20 +38,7 @@ else exit 1 fi -echo "Checking for expected files..." -MISSING_FILES=0 -for filename in $EXPECTED_FILES; do - if ! find "$EXTRACT_DIR" -name "$filename" -print | grep -q .; then - echo "Warning: Expected file '$filename' not found in the zip archive." - MISSING_FILES=$((MISSING_FILES + 1)) - fi -done - -if [ "$MISSING_FILES" -gt 0 ]; then - echo "$MISSING_FILES expected file(s) were not found in the zip archive." -fi - -echo "Moving extracted files to $TARGET_DIR/..." -mv "$EXTRACT_DIR"/* "$TARGET_DIR/" 2>/dev/null || true +echo "Flattening all files from extracted archive…" +find "$EXTRACT_DIR" -type f -exec mv -f {} "$TARGET_DIR/" \; echo "Process completed."