#!/bin/sh
set -e

# ---------------------------------------------------------------------
# Post-removal script for PyCharm CE
# Removes /opt/pycharm-ce when the package is removed or purged
# ---------------------------------------------------------------------

optdir="/opt/pycharm-ce"

case "$1" in
    remove|purge)
        if [ -d "$optdir" ]; then
            echo "Removing PyCharm CE installation from $optdir..."
            rm -rf "$optdir"
        fi
        ;;
    upgrade|failed-upgrade|abort-install)
        # No action needed
        ;;
esac

exit 0

