mirror of
https://github.com/crosstool-ng/crosstool-ng.git
synced 2025-02-20 17:12:55 +00:00
Add a new helper function: CT_DoExecLog.
It is similar to CT_DoLog, but instead of printing its arguments, it uses them as a command, and logs the output of that command. /trunk/scripts/functions | 8 8 0 0 ++++++++ 1 file changed, 8 insertions(+)
This commit is contained in:
parent
3d9cc3d036
commit
91c6e16780
@ -105,6 +105,14 @@ CT_DoLog() {
|
||||
return 0
|
||||
}
|
||||
|
||||
# Execute an action, and log its messages
|
||||
# Usage: CT_DoExecLog <level> <[VAR=val...] command [parameters...]>
|
||||
CT_DoExecLog() {
|
||||
local level="$1"
|
||||
shift
|
||||
eval "$@" 2>&1 |CT_DoLog "${level}"
|
||||
}
|
||||
|
||||
# Tail message to be logged whatever happens
|
||||
# Usage: CT_DoEnd <level>
|
||||
CT_DoEnd()
|
||||
|
Loading…
x
Reference in New Issue
Block a user