#!/bin/bash

[ -f "$HOME/.local/snippets/apply-color-helper" ] || {
    echo "Missing helper script: $HOME/.local/snippets/apply-color-helper"
    exit 1
}
. "$HOME/.local/snippets/apply-color-helper"

dir="$path"/../../../../assets

file=$(find "$dir" -type f -name "catppuccin-mocha-${colorName}.toml" | head -n 1)

[[ -z "$file" ]] && {
    log_error "Theme file not found for color: $colorName"
    exit 1
}

cp -f "$file" "$path"/../yazi/theme.toml || {
    log_error "Failed to copy theme file"
    exit 1
}

log_success "yazi"
