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
|
||||
|
|
10
test.sh
10
test.sh
|
@ -5,14 +5,14 @@ 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
|
||||
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