#!/bin/sh
# Initialise les icônes seeds dans le volume si le dossier est vide
ICONS_DIR="/app/data/icons"
SEED_DIR="/app/icons_seed_init"

mkdir -p "$ICONS_DIR"

if [ -d "$SEED_DIR" ]; then
  for f in "$SEED_DIR"/*; do
    [ -f "$f" ] || continue
    dest="$ICONS_DIR/$(basename "$f")"
    if [ ! -f "$dest" ]; then
      cp "$f" "$dest"
    fi
  done
fi

exec "$@"
