#!/bin/bash
# ============================================================================
# DeepFryer - Linux Installer
# Copyright (c) 2026 MousePlugins. All rights reserved.
# https://mouseplugins.com
# ============================================================================

set -e

PLUGIN_NAME="DeepFryer"
VERSION="1.0.1"
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"

VST3_SRC="$SCRIPT_DIR/VST3/${PLUGIN_NAME}.vst3"
CLAP_SRC="$SCRIPT_DIR/CLAP/${PLUGIN_NAME}.clap"

VST3_DEST="$HOME/.vst3"
CLAP_DEST="$HOME/.clap"

echo ""
echo "  $PLUGIN_NAME $VERSION - Linux Installer"
echo "  MousePlugins - mouseplugins.com"
echo "  ----------------------------------------"
echo ""

if [ -d "$VST3_SRC" ]; then
    mkdir -p "$VST3_DEST"
    rm -rf "$VST3_DEST/${PLUGIN_NAME}.vst3"
    cp -r "$VST3_SRC" "$VST3_DEST/"
    echo "  [OK] VST3  -> $VST3_DEST/${PLUGIN_NAME}.vst3"
else
    echo "  [--] VST3  - not found in package, skipped"
fi

if [ -f "$CLAP_SRC" ]; then
    mkdir -p "$CLAP_DEST"
    rm -f "$CLAP_DEST/${PLUGIN_NAME}.clap"
    cp "$CLAP_SRC" "$CLAP_DEST/"
    echo "  [OK] CLAP  -> $CLAP_DEST/${PLUGIN_NAME}.clap"
else
    echo "  [--] CLAP  - not found in package, skipped"
fi

echo ""
echo "  Installation complete."
echo "  Rescan plugins in your DAW to use $PLUGIN_NAME."
echo ""
