#!/usr/bin/env bash # utils.sh - Utility functions for the project # Function to check if a required command is available need() { command -v "$1" >/dev/null || { echo "❌ $1 is required but not installed"; exit 1; } } # Function to log messages with levels log() { local level="$1" local message="$2" echo "[$level] $message" } # Function to validate input arguments validate_arg() { local arg_name="$1" local arg_value="$2" if [[ -z "$arg_value" ]]; then log "ERROR" "Missing required argument: $arg_name" exit 1 fi }