#!/bin/bash # ─< Check if the given command exists silently >───────────────────────────────────────── command_exists() { command -v "$@" >/dev/null 2>&1 } NAME="testimage" TAG="latest" if command_exists docker; then if [ -e Dockerfile ]; then docker build -t "${NAME}:${TAG}" . fi fi