From ed889def9dceb13e9ff5853685ef59532a7b77e6 Mon Sep 17 00:00:00 2001 From: Noah Bliss <25372928+noahbliss@users.noreply.github.com> Date: Tue, 12 May 2026 14:25:59 +0300 Subject: [PATCH] Support Debian in toolbox/distrobox command check (#88) * Support Debian in toolbox command check Debian requires distrobox, like Ubuntu. This is a simple change to add support for it. * Consolidation of logic copilot complained, so used this as an opportunity to collapse unnecessary evals. --- refresh-toolboxes.sh | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/refresh-toolboxes.sh b/refresh-toolboxes.sh index 610fc13..c697010 100755 --- a/refresh-toolboxes.sh +++ b/refresh-toolboxes.sh @@ -21,26 +21,21 @@ function usage() { } # Check OS and set appropriate toolbox command -IS_UBUNTU=false if [ -f /etc/os-release ]; then . /etc/os-release - if [ "$ID" = "ubuntu" ]; then - IS_UBUNTU=true + if [ "$ID" = "ubuntu" ] || [ "$ID" = "debian" ]; then + TOOLBOX_CMD="distrobox" + else + TOOLBOX_CMD="toolbox" fi fi -if [ "$IS_UBUNTU" = true ]; then - TOOLBOX_CMD="distrobox" -else - TOOLBOX_CMD="toolbox" -fi - # Check dependencies DEPENDENCIES=("podman" "$TOOLBOX_CMD") for cmd in "${DEPENDENCIES[@]}"; do if ! command -v "$cmd" > /dev/null; then - if [ "$cmd" = "distrobox" ] && [ "$IS_UBUNTU" = true ]; then - echo "Error: 'distrobox' is not installed. Ubuntu users must use distrobox instead of toolbox." >&2 + if [ "$cmd" = "distrobox" ]; then + echo "Error: 'distrobox' is not installed. Debian-based distributions (like Ubuntu) must use distrobox instead of toolbox." >&2 echo "Please install distrobox (e.g., sudo apt install distrobox) and try again." >&2 else echo "Error: '$cmd' is not installed." >&2