#!/usr/bin/env bash
set -euo pipefail

INSTALL_BASE_URL="${INSTALL_BASE_URL:-https://install.cuteos.io}"
SCRIPT_URL="${INSTALL_SCRIPT_URL:-${INSTALL_BASE_URL%/}/install-docker-desktop-k8s.sh}"

temp_dir="$(mktemp -d)"
trap 'rm -rf "${temp_dir}"' EXIT

# Keep the hosted entrypoint thin so install.cuteos.io can redirect callers to the
# current platform installer without shipping repository state in the one-line curl path.
curl -fsSL "${SCRIPT_URL}" -o "${temp_dir}/install-docker-desktop-k8s.sh"
chmod +x "${temp_dir}/install-docker-desktop-k8s.sh"
exec "${temp_dir}/install-docker-desktop-k8s.sh" "$@"
