dist/tools/build_system_sanity_check: handle error by prepending
Handle putting the final error message by prepending the output. This removes issue with errors being concatenated and gives an interractive output. The errors are now send to stderr.
This commit is contained in:
parent
ef24df7ac0
commit
534ccaf5ee
19
dist/tools/buildsystem_sanity_check/check.sh
vendored
19
dist/tools/buildsystem_sanity_check/check.sh
vendored
@ -110,19 +110,14 @@ error_on_input() {
|
||||
grep '' && return 1
|
||||
}
|
||||
|
||||
all_checks() {
|
||||
check_not_parsing_features
|
||||
check_not_exporting_variables
|
||||
}
|
||||
|
||||
main() {
|
||||
local errors=''
|
||||
|
||||
errors+="$(check_not_parsing_features)"
|
||||
errors+="$(check_not_exporting_variables)"
|
||||
|
||||
if [ -n "${errors}" ]
|
||||
then
|
||||
printf 'Invalid build system patterns found by %s:\n' "${0}"
|
||||
printf '%s\n' "${errors}"
|
||||
exit 1
|
||||
fi
|
||||
exit 0
|
||||
all_checks | prepend 'Invalid build system patterns found by '"${0}:" || error_on_input >&2
|
||||
exit $?
|
||||
}
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user