diff --git a/bb.sh b/bb.sh index 2a08eca..6973d07 100755 --- a/bb.sh +++ b/bb.sh @@ -161,23 +161,8 @@ global_variables_check() { # Test if the markdown script is working correctly test_markdown() { - [[ -z $markdown_bin ]] && return 1 - [[ -z $(which diff) ]] && return 1 - - in=/tmp/md-in-${RANDOM}.md - out=/tmp/md-out-${RANDOM}.html - good=/tmp/md-good-${RANDOM}.html - echo -e "line 1\n\nline 2" > "$in" - echo -e "

line 1

\n\n

line 2

" > "$good" - "$markdown_bin" "$in" > "$out" 2> /dev/null - diff $good $out &> /dev/null # output is irrelevant, we'll check $? - if (($? != 0)); then - rm -f "$in" "$good" "$out" - return 1 - fi - - rm -f "$in" "$good" "$out" - return 0 + [[ -n $markdown_bin ]] && + [[ $("$markdown_bin" <<< $'line 1\n\nline 2') == $'

line 1

\n\n

line 2

' ]] } @@ -220,7 +205,7 @@ disqus_body() { echo '