#!/usr/bin/env bash # Shared helpers for derp container tools. # Sourced, not executed. # shellcheck disable=SC2034 set -euo pipefail SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[1]}")" && pwd)" PROJECT_DIR="$(cd "$SCRIPT_DIR/.." && pwd)" # Compose command detection if podman compose version &>/dev/null; then COMPOSE="podman compose" elif command -v podman-compose &>/dev/null; then COMPOSE="podman-compose" else echo "error: podman compose or podman-compose required" >&2 exit 1 fi CONTAINER_NAME="derp" # podman-compose names images _ IMAGE_NAME="derp_derp" # Colors (suppressed if NO_COLOR is set or stdout isn't a tty) if [[ -z "${NO_COLOR:-}" ]] && [[ -t 1 ]]; then GRN='\e[38;5;108m' RED='\e[38;5;131m' BLU='\e[38;5;110m' DIM='\e[2m' RST='\e[0m' else GRN='' RED='' BLU='' DIM='' RST='' fi info() { printf "${GRN}%s${RST} %s\n" "✓" "$*"; } err() { printf "${RED}%s${RST} %s\n" "✗" "$*" >&2; } dim() { printf "${DIM} %s${RST}\n" "$*"; }