diff --git a/client/src/docker/lib/internal/lib_docker.bash b/client/src/docker/lib/internal/lib_docker.bash index 802f6d5..c793762 100644 --- a/client/src/docker/lib/internal/lib_docker.bash +++ b/client/src/docker/lib/internal/lib_docker.bash @@ -394,9 +394,14 @@ function lib_docker::__run() lib_utils::print_debug "Creating network" docker network create "$global_network" &>/dev/null - # NOTE: runs bash as interactive so .bashrc doesn't `return` (sources/aliases are needed) lib_utils::print_debug "Spawning container with command '$*'" - lib_docker::__docker_compose run -it --rm --entrypoint='/bin/bash -i -c' docker-finance "$@" + + # Terminal requirements (e.g., for cron, don't allocate TTY) + local _tty + test -t 1 && _tty="t" + + # NOTE: runs bash as interactive so .bashrc doesn't `return` (sources/aliases are needed) + lib_docker::__docker_compose run -i"${_tty}" --rm --entrypoint='/bin/bash -i -c' docker-finance "$@" local -r _return=$? lib_utils::print_debug "Removing network"