Quellcode durchsuchen

better one-liner

Ryan Brunt vor 5 Jahren
Ursprung
Commit
39d0bacbfc
1 geänderte Dateien mit 1 neuen und 3 gelöschten Zeilen
  1. 1 3
      tmpmail

+ 1 - 3
tmpmail

@@ -194,9 +194,7 @@ view_email() {
     FROM=$(jq -r ".from" <<<"$DATA")
     SUBJECT=$(jq -r ".subject" <<<"$DATA")
     HTML_BODY=$(jq -r ".htmlBody" <<<"$DATA")
-    if [ -z "$HTML_BODY"]; then
-         HTML_BODY=$(jq -r ".textBody" <<<"$DATA")
-     fi
+    [ -z "$HTML_BODY" ] && HTML_BODY=$(jq -r ".textBody" <<<"$DATA")
 
     # Create the HTML with all the information that is relevant and then
     # assigning that HTML to the variable HTML_MAIL. This is the best method