mirror of
https://github.com/armbian/build
synced 2025-09-24 19:47:06 +07:00
armbian-next: split of config-prepare into multiple functions, allowing for logging of all non-interactive sections
- introduce `do_with_conditional_logging()` which only starts logging sections if `do_logging=no` - with this we should get complete logs (ofc except for the interactive sections)
This commit is contained in:
@@ -120,10 +120,21 @@ function do_with_logging() {
|
||||
function do_with_logging_unless_user_terminal() {
|
||||
# Is user on a terminal? If so, don't log, just show on screen.
|
||||
if [[ -t 1 ]]; then
|
||||
display_alert "User is on a terminal, not logging output" "terminal" "debug"
|
||||
display_alert "User is on a terminal, not logging output" "do_with_logging_unless_user_terminal" "debug"
|
||||
"$@"
|
||||
else
|
||||
display_alert "User is not on a terminal, logging output" "terminal" "debug"
|
||||
display_alert "User is not on a terminal, logging output" "do_with_logging_unless_user_terminal" "debug"
|
||||
do_with_logging "$@"
|
||||
fi
|
||||
}
|
||||
|
||||
function do_with_conditional_logging() {
|
||||
# if "do_logging=no", just run the command, otherwise, log it.
|
||||
if [[ "${do_logging:-"yes"}" == "no" ]]; then
|
||||
display_alert "do_logging=no, not starting logging section" "do_with_conditional_logging" "debug"
|
||||
"$@"
|
||||
else
|
||||
display_alert "normally logging output" "do_with_conditional_logging" "debug"
|
||||
do_with_logging "$@"
|
||||
fi
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user