Skip to content

Commit b36502e

Browse files
committed
build/unit-in-container.sh: simplify runtime search
The code was correct but too long. Signed-off-by: Kir Kolyshkin <[email protected]>
1 parent 8b96dc6 commit b36502e

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

build/unit-in-container.sh

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,8 @@
1616

1717
set -e
1818

19-
CONTAINER_ENGINE=$(command -v docker || true)
20-
if [ "$CONTAINER_ENGINE" == "" ]; then
21-
CONTAINER_ENGINE=$(command -v podman || true)
22-
fi
23-
if [ "$CONTAINER_ENGINE" == "" ]; then
24-
echo "Unable to find docker and podman. Exiting."
19+
if ! CONTAINER_ENGINE=$(command -v docker || command -v podman); then
20+
echo "Neither docker nor podman found. Exiting."
2521
exit 1
2622
fi
2723

0 commit comments

Comments
 (0)