#!/usr/bin/env bash

# Remove VSCodium

SRC=$(grep "repo.vscodium.dev" /etc/apt/sources.list.d/* | cut -d':' -f 1)

apt-get purge -y --autoremove codium

if command -v codium >/dev/null 2>&1; then
    echo "Failed to remove Codium"
    exit 1
fi

if [ -n "$SRC" ]; then
    rm -vf "$SRC"
    apt-get update
else
    echo "repo.vscodium.dev was not installed: not removed"
fi

exit 0
