Closed Tantrisse closed 3 years ago
Ok, I'm closing for now, /dev/tty
break all tests because they need the text to be in the output stream.
I'll try another way with (maybe output debug
in the error stream >&2
?)
Anyway, for now the tests fail in my machine because the docker image are missing some ARG
and centos refuse to build because of too old make
... (??)
Hi,
The debug function sometimes cause problem when used inside function which return a value.
As an example, in the "update" function, we get the version via
version=$(get_bin_version)
. Inget_bin_version
, we callas_user
which return the bash output in the main stream.But if debug is true, the debug function will print the result of
debug "as_user: $1}"
in the main stream and mess up the return value ofas_user
breaking badly the update function :We can see here the output of the debug function is mixed in.
This fix modify the debug function making it print the debug message in
/dev/tty
(the terminal directly), making the function itself not returning anything and so not messing up with any code calling it.Tell me what you think about it,
/dev/tty
seems the right solution to me but you may have a better idea ?