SearXNG is a free internet metasearch engine which aggregates results from various search services and databases. Users are neither tracked nor profiled.
Python bingbravedegoogleduckduckgogooglemetasearchprivacypythonqwantsearchsearch-enginesearxsearxngstartpageyahoo
[mod] lib_sxng_container.sh use required_commands() helper
Ivan Gabaldon64a5b6920f1f
diff --git a/utils/lib_sxng_container.sh b/utils/lib_sxng_container.shindex b3f84594f..1df9ef358 100644--- a/utils/lib_sxng_container.sh+++ b/utils/lib_sxng_container.sh@@ -19,24 +19,14 @@ container.build() {local variantlocal platform- # Check if git is installed- if ! command -v git &>/dev/null; then- die 1 "Git is not installed"- fi+ required_commands git# Check if podman or docker is installed- if [ "$1" = "docker" ]; then- if command -v docker &>/dev/null; then- container_engine="docker"- else- die 1 "Docker is not installed"- fi- elif [ "$1" = "podman" ]; then- if command -v podman &>/dev/null; then- container_engine="podman"- else- die 1 "Podman is not installed"+ if [ "$1" = "podman" ] || [ "$1" = "docker" ]; then+ if ! command -v "$1" &>/dev/null; then+ die 42 "$1 is not installed"fi+ container_engine="$1"else# If no explicit engine is passed, prioritize podman over dockerif command -v podman &>/dev/null; then@@ -44,7 +34,7 @@ container.build() {elif command -v docker &>/dev/null; thencontainer_engine="docker"else- die 1 "Podman/Docker is not installed"+ die 42 "no compatible container engine is installed (podman or docker)"fifiinfo_msg "Selected engine: $container_engine"@@ -168,10 +158,7 @@ container.test() {die 1 "This command is intended to be run in GitHub Actions"fi- # Check if podman is installed- if ! command -v podman &>/dev/null; then- die 1 "podman is not installed"- fi+ required_commands podman# Setup arch specificcase $parch in@@ -234,10 +221,7 @@ container.push() {die 1 "This command is intended to be run in GitHub Actions"fi- # Check if podman is installed- if ! command -v podman &>/dev/null; then- die 1 "podman is not installed"- fi+ required_commands podmanfor arch in "${release_archs[@]}"; docase $arch in