client: lib_docker: exec: silence noise when not debugging
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user