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
|
||||||
|
|
10
test.sh
10
test.sh
|
@ -5,14 +5,14 @@ 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
|
||||||
fi
|
fi
|
||||||
|
|
||||||
$CONTAINER_RUNTIME exec --user 33 nextcloud bash -c 'cd /var/www/html/custom_apps/upschooling && make test'
|
$CONTAINER_RUNTIME exec --user 33 nextcloud bash -c 'cd /var/www/html/custom_apps/upschooling && make test'
|
||||||
|
|
Loading…
Reference in a new issue