client: lib_docker: exec: silence noise when not debugging

This commit is contained in:
2026-02-17 12:23:20 -08:00
parent dc2f6eec3b
commit e481faf1b9

View File

@@ -510,9 +510,21 @@ function lib_docker::__shell()
function lib_docker::__exec()
{
[ -z "$DOCKER_FINANCE_DEBUG" ] && lib_utils::die_fatal
# Allocate pseudo-TTY, if needed
# NOTE: interactive is kept for cases in which the passed command requires it
local _tty
test -t 1 && _tty="t"
docker exec -i"$_tty" "$global_container" /bin/bash -i -c "$@"
local -r _exec=("docker" "exec" "-i$_tty" "$global_container" "/bin/bash" "-i" "-c" "$@")
if [ "$DOCKER_FINANCE_DEBUG" -eq 0 ]; then
# Silence `bash: cannot set terminal process group (-1): Inappropriate ioctl for device`
# NOTE: lib_utils error handling will still function as expected
"${_exec[@]}" 2>/dev/null
else
"${_exec[@]}"
fi
}
function lib_docker::__parse_args_edit()