#!/bin/bash

# Set base paths
BASE_DIR="$(pwd)"  # Or set manually if you want
DEST_DIR="$BASE_DIR/Links/Listings/png"

# Create destination folder if it doesn't exist
mkdir -p "$DEST_DIR"

# Find all PNG files in */listing/png/
find "$BASE_DIR" -type d -path "*/*Artwork/listing/png" | while read -r png_dir; do
  find "$png_dir" -type f -name "*.png" | while read -r png_file; do
    # Get just the file name
    filename=$(basename "$png_file")
    # Create symlink in destination
    ln -sfn "$png_file" "$DEST_DIR/$filename"
  done
done

echo "✅ All PNG files linked into $DEST_DIR"
