From 15204cda6364afe4e50b3dfe365b4638910a3334 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Fri, 11 Sep 2026 14:41:18 +0100 Subject: xbmk: re-introduce condensed if statements i've been careful to makely only use it on AND operations, not onse that use OR. a lot of blocks are not condensed, unlike previously when this design was used. i removed the condensed design because it made the code allegedly easier to read, but i found it harder to read and found the code looked dirty. this change makes it clean again, but i've done it in a way where the shorthand conditional statements are easy to understand for most people. this strikes a compromise; i would go further. Signed-off-by: Leah Rowe --- include/release.sh | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'include/release.sh') diff --git a/include/release.sh b/include/release.sh index e9017a05..d0b35edd 100644 --- a/include/release.sh +++ b/include/release.sh @@ -16,9 +16,8 @@ release() while getopts m: option do - if [ -z "$OPTARG" ]; then + [ -z "$OPTARG" ] && \ err "empty argument not allowed" "release" "$@" - fi case "$option" in m) @@ -31,9 +30,8 @@ release() done reldest="$reldir/$version" - if [ -e "$reldest" ]; then + [ -e "$reldest" ] && \ err "already exists: \"$reldest\"" "release" "$@" - fi vdir="`mktemp -d || err "can't make vdir"`" || \ err "can't make tmp vdir" "release" "$@" @@ -47,9 +45,9 @@ release() prep_release src prep_release tarball - if [ "$relmode" != "src" ]; then + [ "$relmode" != "src" ] && \ prep_release bin - fi + x_ rm -Rf "$rsrc" x_ xbmkdir "$reldir" @@ -64,9 +62,8 @@ prep_release() ( if [ "$1" != "tarball" ]; then x_ cd "$rsrc" - if [ ! -e "cache" ]; then - x_ ln -s "$XBMK_CACHE" "cache" - fi + [ ! -e "cache" ] && \ + x_ ln -s "$XBMK_CACHE" "cache"; : fi prep_release_$1 @@ -93,7 +90,6 @@ nuke() if [ -d "${r%/*}" ]; then x_ cd "${r%/*}" - dx_ "x_ rm -Rf" "$rsrc/$1" fi } -- cgit v1.2.1