From b71ad82b0e4b34ef3513f6115fe257c883700a0b Mon Sep 17 00:00:00 2001 From: Thorsten Behrens Date: Sat, 20 May 2017 05:03:08 +0200 Subject: mkdocs.sh: support more than one markdown converter binary Change-Id: Ib3f79dd53e96c8f6d40c9c6614db5c672f24ba97 --- solenv/bin/mkdocs.sh | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'solenv/bin') diff --git a/solenv/bin/mkdocs.sh b/solenv/bin/mkdocs.sh index cd2a33f6d485..1be57f9cc8f5 100755 --- a/solenv/bin/mkdocs.sh +++ b/solenv/bin/mkdocs.sh @@ -90,13 +90,17 @@ function proc_text_markdown { } function check_cmd { - cmd_needed="$1" + cmds_needed="$1" error_msg="$2" - which $cmd_needed > /dev/null 2>&1 || { - echo "$error_msg" >&2 - exit 1 - } + found=0 + for cmd_needed in $cmds_needed; do + which $cmd_needed > /dev/null 2>&1 && found=1 + done + if [ $found = 0 ]; then + echo "$error_msg" >&2 + exit 1 + fi } function setup { @@ -115,7 +119,7 @@ function setup { # binaries that we need check_cmd doxygen "You need doxygen for doc generation" check_cmd dot "You need the graphviz tools to create the nice inheritance graphs" -check_cmd markdown "You need markdown in order to convert README.md into html" +check_cmd "markdown markdown2" "You need either markdown or markdown2 in order to convert README.md into html" # suck setup setup "SOLARINC" -- cgit