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%/*})"
|
DIR="$(realpath ${0%/*})"
|
||||||
RUNTIME_IS_PODMAN="false"
|
RUNTIME_IS_PODMAN="false"
|
||||||
if [[ -x "$(which podman)" ]]; then
|
if [[ -x "$(command -v podman)" ]]; then
|
||||||
CONTAINER_RUNTIME="$(which podman 2> /dev/null)"
|
CONTAINER_RUNTIME="$(command -v podman 2> /dev/null)"
|
||||||
RUNTIME_IS_PODMAN="true"
|
RUNTIME_IS_PODMAN="true"
|
||||||
elif [[ -x "$(which docker)" ]]; then
|
elif [[ -x "$(command -v docker)" ]]; then
|
||||||
CONTAINER_RUNTIME="$(which docker 2> /dev/null)"
|
CONTAINER_RUNTIME="$(command -v docker 2> /dev/null)"
|
||||||
else
|
else
|
||||||
echo "Container runtime (docker/podman) not found!"
|
echo "Container runtime (docker/podman) not found!"
|
||||||
exit 1
|
exit 1
|
||||||
|
|
8
test.sh
8
test.sh
|
@ -5,11 +5,11 @@ IFS=$'\n\t'
|
||||||
|
|
||||||
DIR="$(realpath ${0%/*})"
|
DIR="$(realpath ${0%/*})"
|
||||||
RUNTIME_IS_PODMAN="false"
|
RUNTIME_IS_PODMAN="false"
|
||||||
if [[ -x "$(which podman)" ]]; then
|
if [[ -x "$(command -v podman)" ]]; then
|
||||||
CONTAINER_RUNTIME="$(which podman 2> /dev/null)"
|
CONTAINER_RUNTIME="$(command -v podman 2> /dev/null)"
|
||||||
RUNTIME_IS_PODMAN="true"
|
RUNTIME_IS_PODMAN="true"
|
||||||
elif [[ -x "$(which docker)" ]]; then
|
elif [[ -x "$(command -v docker)" ]]; then
|
||||||
CONTAINER_RUNTIME="$(which docker 2> /dev/null)"
|
CONTAINER_RUNTIME="$(command -v docker 2> /dev/null)"
|
||||||
else
|
else
|
||||||
echo "Container runtime (docker/podman) not found!"
|
echo "Container runtime (docker/podman) not found!"
|
||||||
exit 1
|
exit 1
|
||||||
|
|
Loading…
Reference in a new issue