Merge branch 'morganamilo/lint' into morganamilo/tip

This commit is contained in:
morganamilo 2021-11-06 23:39:30 +00:00
commit d4b4d315aa
No known key found for this signature in database
GPG key ID: E48D0A8326DE47C5

View file

@ -28,7 +28,7 @@ source "$LIBRARY/util/pkgbuild.sh"
source "$LIBRARY/util/schema.sh"
lint_pkgbuild_functions+=('lint_variable')
lint_pkgbuild_functions+=('lint_array')
lint_variable() {
local i a pkg out bad ret=0
@ -95,3 +95,21 @@ lint_variable() {
return $ret
}
lint_array() {
local i var ret=0
for i in ${pkgbuild_schema_arrays[@]}; do
local l=()
get_pkgbuild_all_split_attributes $i l
for var in "${l[@]}"; do
if [[ -z $var ]]; then
error "$(gettext "%s does not allow empty values.")" "$i"
ret=1
fi
done
done
return $ret
}