From 988bc7061938720152169cadaa6ed2bd9af6270b Mon Sep 17 00:00:00 2001 From: Wynn Wolf Arbor Date: Thu, 4 Jun 2020 13:56:22 +0200 Subject: Use OR lists instead of if commands Use a more succinct and clear style in two places by converting if commands into simple OR lists. --- kern | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/kern b/kern index c6b2a57..d95ab9b 100755 --- a/kern +++ b/kern @@ -35,9 +35,7 @@ set_kernel() { current=$(get_current_kernel) kerndir=$SRCDIR/$kern - if test ! -d "$kerndir"; then - errx "No such file or directory: $kerndir" - fi + test -d "$kerndir" || errx "No such file or directory: $kerndir" if test "$kern" = "$current"; then err "Warning: Latest kernel already selected: $kern" @@ -53,9 +51,7 @@ set_kernel() { config_kernel() { host=${1:-$(hostname)} - if test ! -d "$KERNFRAG"; then - errx "No such file or directory: $KERNFRAG" - fi + test -d "$KERNFRAG" || errx "No such file or directory: $KERNFRAG" printf "Starting merge for %s...\n\n" "$host" -- cgit v1.2.3-2-gb3c3