summaryrefslogtreecommitdiff
path: root/include/lib.sh
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2024-06-27 02:52:46 +0100
committerLeah Rowe <leah@libreboot.org>2024-06-27 02:52:46 +0100
commit671893a802cb9f7b684037062d0debd1c049addb (patch)
treef5e1b54b7e9423e54a93e7ce313a8a058d64f694 /include/lib.sh
parent19bc5845a6ab274bee52a28747ced067b264a259 (diff)
lib.sh: condense setcfg() if/else logic
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'include/lib.sh')
-rwxr-xr-xinclude/lib.sh9
1 files changed, 3 insertions, 6 deletions
diff --git a/include/lib.sh b/include/lib.sh
index 27cf184f..c57bbd0d 100755
--- a/include/lib.sh
+++ b/include/lib.sh
@@ -49,12 +49,9 @@ chkvars projectname projectsite
setcfg()
{
- if [ $# -gt 1 ]; then
- printf "e \"%s\" f missing && return %s;\n" "$1" "$2"
- else
- printf "e \"%s\" f missing && %s \"Missing config\";\n" "$1" \
- "$err"
- fi
+ [ $# -gt 1 ] && printf "e \"%s\" f missing && return %s;\n" "$1" "$2"
+ [ $# -gt 1 ] || \
+ printf "e \"%s\" f not && %s \"Missing config\";\n" "$1" "$err"
printf ". \"%s\" || %s \"Could not read config\";\n" "$1" "$err"
}