#!/bin/sh
set -eu

SERVICE_HELPER="/opt/codex-desktop/update-builder/packaging/linux/codex-update-manager-user-service.sh"
DESKTOP_ENTRY_DOCTOR="/opt/codex-desktop/.codex-linux/codex-desktop-entry-doctor.sh"
if [ -f "$SERVICE_HELPER" ]; then
    # shellcheck source=/opt/codex-desktop/update-builder/packaging/linux/codex-update-manager-user-service.sh
    . "$SERVICE_HELPER"
    codex_ensure_user_service_running || true
fi
if [ -f "$DESKTOP_ENTRY_DOCTOR" ]; then
    # shellcheck source=/opt/codex-desktop/.codex-linux/codex-desktop-entry-doctor.sh
    . "$DESKTOP_ENTRY_DOCTOR"
    codex_desktop_repair_system_package_shadow_entries codex-desktop || true
fi

exit 0
