diff options
author | Michael Boelen <michael.boelen@cisofy.com> | 2016-09-24 16:34:05 +0300 |
---|---|---|
committer | Michael Boelen <michael.boelen@cisofy.com> | 2016-09-24 16:34:05 +0300 |
commit | fb88bcaf1f7e7e6cc617a0b1a7f342bbfa5a009e (patch) | |
tree | 6aa623a41c6baefd1fed5b6072425519afaa42b0 | |
parent | 263c0b558bb7a054c2a6aec82e997922980271d5 (diff) |
Style improvements
-rw-r--r-- | include/report | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/include/report b/include/report index e38d29ad..e6cee2a3 100644 --- a/include/report +++ b/include/report @@ -108,9 +108,8 @@ if [ "${CUSTOM_URL_APPEND}" = "" ]; then CUSTOM_URL_APPEND="/"; fi # Show warnings from logfile - SWARNINGS=`grep -i 'warning:' ${LOGFILE} | sed 's/ /!space!/g'` - - if [ "${SWARNINGS}" = "" ]; then + SWARNINGS=$(${GREPBINARY} -i 'warning:' ${LOGFILE} | sed 's/ /!space!/g') + if [ -z "${SWARNINGS}" ]; then echo " ${OK}Great, no warnings${NORMAL}"; echo "" else echo " ${WARNING}Warnings${NORMAL} (${TOTAL_WARNINGS}):" @@ -131,7 +130,7 @@ echo " ${RED}!${NORMAL} ${SHOWWARNING}" if [ ! "${DETAILS}" = "-" ]; then echo " - Details : ${CYAN}${DETAILS}${NORMAL}"; fi if [ ${SHOW_REPORT_SOLUTION} -eq 1 -a ! "${SOLUTION}" = "-" ]; then echo " - Solution : ${SOLUTION}"; fi - if [ "${IS_CUSTOM}" = "" ]; then + if [ -z "${IS_CUSTOM}" ]; then echo " ${CONTROL_URL_PROTOCOL}://${CONTROL_URL_PREPEND}${ADDLINK}${CONTROL_URL_APPEND}" else echo " ${CUSTOM_URL_PROTOCOL}://${CUSTOM_URL_PREPEND}${ADDLINK}${CUSTOM_URL_APPEND}" @@ -150,9 +149,9 @@ echo " ${WHITE}----------------------------${NORMAL}" for SUGGESTION in ${SSUGGESTIONS}; do SOLUTION="" - SHOWSUGGESTION=`echo ${SUGGESTION} | sed 's/!space!/ /g' | sed 's/^.* Suggestion: //' | sed 's/\[details:\(.*\)\] \[solution:\(.*\)\]//' | sed 's/test://'` - ADDLINK=`echo ${SUGGESTION} | sed 's/!space!/ /g' | sed 's/^.* Suggestion: \(.*\)\[test://' | sed 's/\]\(.*\)]//'` - DETAILS=`echo ${SUGGESTION} | sed 's/!space!/ /g' | sed 's/^.* Suggestion: \(.*\)\[details://' | sed 's/\]\(.*\)]//'` + SHOWSUGGESTION=$(echo ${SUGGESTION} | sed 's/!space!/ /g' | sed 's/^.* Suggestion: //' | sed 's/\[details:\(.*\)\] \[solution:\(.*\)\]//' | sed 's/test://') + ADDLINK=$(echo ${SUGGESTION} | sed 's/!space!/ /g' | sed 's/^.* Suggestion: \(.*\)\[test://' | sed 's/\]\(.*\)]//') + DETAILS=$(echo ${SUGGESTION} | sed 's/!space!/ /g' | sed 's/^.* Suggestion: \(.*\)\[details://' | sed 's/\]\(.*\)]//') SUGGESTION_PIECES=$(echo ${SUGGESTION} | sed 's/\[/ [/g') for PIECE in ${SUGGESTION_PIECES}; do if [ -z "${SOLUTION}" ]; then @@ -164,7 +163,7 @@ echo " ${YELLOW}*${NORMAL} ${SHOWSUGGESTION}" if [ ! "${DETAILS}" = "-" ]; then echo " - Details : ${CYAN}${DETAILS}${NORMAL}"; fi if [ ${SHOW_REPORT_SOLUTION} -eq 1 -a ! "${SOLUTION}" = "-" ]; then echo " - Solution : ${SOLUTION}"; fi - if [ "${IS_CUSTOM}" = "" ]; then + if [ -z "${IS_CUSTOM}" ]; then echo " ${GRAY}${CONTROL_URL_PROTOCOL}://${CONTROL_URL_PREPEND}${ADDLINK}${CONTROL_URL_APPEND}${NORMAL}" else echo " ${GRAY}${CUSTOM_URL_PROTOCOL}://${CUSTOM_URL_PREPEND}${ADDLINK}${CUSTOM_URL_APPEND}${NORMAL}" |