This commit is contained in:
Jephté Clain 2019-01-14 16:09:03 +04:00
parent 41089f7ed0
commit edaaec19ee
1 changed files with 18 additions and 14 deletions

16
dk
View File

@ -267,14 +267,16 @@ function auto_up() {
} }
function default_compose_service() { function default_compose_service() {
local docker_compose="$(which docker-compose)" local docker_compose="$(which docker-compose 2>/dev/null)"
if [ -z "$docker_compose" -a -x /usr/bin/docker-compose ]; then if [ -z "$docker_compose" ]; then
if [ -x /usr/bin/docker-compose ]; then
docker_compose=/usr/bin/docker-compose docker_compose=/usr/bin/docker-compose
elif [ -z "$docker_compose" -a -x /usr/local/bin/docker-compose ]; then elif [ -x /usr/local/bin/docker-compose ]; then
docker_compose=/usr/local/bin/docker-compose docker_compose=/usr/local/bin/docker-compose
else else
die "Impossible de trouver docker-compose" die "Impossible de trouver docker-compose"
fi fi
fi
setx startcmd=qvals "$docker_compose" \ setx startcmd=qvals "$docker_compose" \
"${replace_env_args[@]}" "${env_args[@]}" \ "${replace_env_args[@]}" "${env_args[@]}" \
up "${replace_run_args[@]}" "${run_args[@]}" \ up "${replace_run_args[@]}" "${run_args[@]}" \
@ -282,14 +284,16 @@ function default_compose_service() {
setx stopcmd=qvals "$docker_compose" down setx stopcmd=qvals "$docker_compose" down
} }
function default_docker_service() { function default_docker_service() {
local docker="$(which docker)" local docker="$(which docker 2>/dev/null)"
if [ -z "$docker" -a -x /usr/bin/docker ]; then if [ -z "$docker" ]; then
if [ -x /usr/bin/docker ]; then
docker=/usr/bin/docker docker=/usr/bin/docker
elif [ -z "$docker" -a -x /usr/local/bin/docker ]; then elif [ -x /usr/local/bin/docker ]; then
docker=/usr/local/bin/docker docker=/usr/local/bin/docker
else else
die "Impossible de trouver docker" die "Impossible de trouver docker"
fi fi
fi
setx startcmd=qvals "$docker" run \ setx startcmd=qvals "$docker" run \
"${replace_env_args[@]}" "${env_args[@]}" \ "${replace_env_args[@]}" "${env_args[@]}" \
"${replace_run_args[@]}" "${run_args[@]}" \ "${replace_run_args[@]}" "${run_args[@]}" \