From 4a8ba629f603497689602e36a466d5c95d457f6e Mon Sep 17 00:00:00 2001 From: Steffen Winter Date: Sun, 24 Aug 2025 13:42:00 +0200 Subject: [PATCH] fix: use more portable `type -p` to find executable `which` is not guaranteed to be installed on all machines. Since the script is meant to be run on the user's host machine it is more portable to use `type -p` here. Closes: https://github.com/dockcross/dockcross/issues/880 --- imagefiles/dockcross.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/imagefiles/dockcross.sh b/imagefiles/dockcross.sh index cb746fb..ca8491a 100755 --- a/imagefiles/dockcross.sh +++ b/imagefiles/dockcross.sh @@ -24,9 +24,9 @@ has() { # If OCI_EXE is not already set, search for a container executor (OCI stands for "Open Container Initiative") if [ -z "$OCI_EXE" ]; then - if which podman >/dev/null 2>/dev/null; then + if type -p podman >/dev/null 2>/dev/null; then OCI_EXE=podman - elif which docker >/dev/null 2>/dev/null; then + elif type -p docker >/dev/null 2>/dev/null; then OCI_EXE=docker else die "Cannot find a container executor. Search for docker and podman."