Use command shell builtin instead of which
This commit is contained in:
parent
e1d7f7c8d9
commit
bf929327c2
8
run.sh
8
run.sh
|
@ -5,11 +5,11 @@ IFS=$'\n\t'
|
|||
|
||||
DIR="$(realpath ${0%/*})"
|
||||
RUNTIME_IS_PODMAN="false"
|
||||
if [[ -x "$(which podman)" ]]; then
|
||||
CONTAINER_RUNTIME="$(which podman 2> /dev/null)"
|
||||
if [[ -x "$(command -v podman)" ]]; then
|
||||
CONTAINER_RUNTIME="$(command -v podman 2> /dev/null)"
|
||||
RUNTIME_IS_PODMAN="true"
|
||||
elif [[ -x "$(which docker)" ]]; then
|
||||
CONTAINER_RUNTIME="$(which docker 2> /dev/null)"
|
||||
elif [[ -x "$(command -v docker)" ]]; then
|
||||
CONTAINER_RUNTIME="$(command -v docker 2> /dev/null)"
|
||||
else
|
||||
echo "Container runtime (docker/podman) not found!"
|
||||
exit 1
|
||||
|
|
8
test.sh
8
test.sh
|
@ -5,11 +5,11 @@ IFS=$'\n\t'
|
|||
|
||||
DIR="$(realpath ${0%/*})"
|
||||
RUNTIME_IS_PODMAN="false"
|
||||
if [[ -x "$(which podman)" ]]; then
|
||||
CONTAINER_RUNTIME="$(which podman 2> /dev/null)"
|
||||
if [[ -x "$(command -v podman)" ]]; then
|
||||
CONTAINER_RUNTIME="$(command -v podman 2> /dev/null)"
|
||||
RUNTIME_IS_PODMAN="true"
|
||||
elif [[ -x "$(which docker)" ]]; then
|
||||
CONTAINER_RUNTIME="$(which docker 2> /dev/null)"
|
||||
elif [[ -x "$(command -v docker)" ]]; then
|
||||
CONTAINER_RUNTIME="$(command -v docker 2> /dev/null)"
|
||||
else
|
||||
echo "Container runtime (docker/podman) not found!"
|
||||
exit 1
|
||||
|
|
Loading…
Reference in a new issue