lib.sh: condense setcfg() if/else logic

Signed-off-by: Leah Rowe <leah@libreboot.org>
audit6
Leah Rowe 2024-06-27 02:52:46 +01:00
parent 19bc5845a6
commit 671893a802
1 changed files with 3 additions and 6 deletions

View File

@ -49,12 +49,9 @@ chkvars projectname projectsite
setcfg() setcfg()
{ {
if [ $# -gt 1 ]; then [ $# -gt 1 ] && printf "e \"%s\" f missing && return %s;\n" "$1" "$2"
printf "e \"%s\" f missing && return %s;\n" "$1" "$2" [ $# -gt 1 ] || \
else printf "e \"%s\" f not && %s \"Missing config\";\n" "$1" "$err"
printf "e \"%s\" f missing && %s \"Missing config\";\n" "$1" \
"$err"
fi
printf ". \"%s\" || %s \"Could not read config\";\n" "$1" "$err" printf ". \"%s\" || %s \"Could not read config\";\n" "$1" "$err"
} }