Pārlūkot izejas kodu

better one-liner

Ryan Brunt 5 gadi atpakaļ
vecāks
revīzija
39d0bacbfc
1 mainītis faili ar 1 papildinājumiem un 3 dzēšanām
  1. 1 3
      tmpmail

+ 1 - 3
tmpmail

@@ -194,9 +194,7 @@ view_email() {
     FROM=$(jq -r ".from" <<<"$DATA")
     FROM=$(jq -r ".from" <<<"$DATA")
     SUBJECT=$(jq -r ".subject" <<<"$DATA")
     SUBJECT=$(jq -r ".subject" <<<"$DATA")
     HTML_BODY=$(jq -r ".htmlBody" <<<"$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
     # 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
     # assigning that HTML to the variable HTML_MAIL. This is the best method