diff options
author | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2017-05-20 05:03:08 +0200 |
---|---|---|
committer | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2017-05-20 05:03:08 +0200 |
commit | b71ad82b0e4b34ef3513f6115fe257c883700a0b (patch) | |
tree | 2471d8d425285e0edb74858820be9a811052d61b /solenv/bin | |
parent | 0215e8f9781a4a306fb16991bccf395472b667cd (diff) |
mkdocs.sh: support more than one markdown converter binary
Change-Id: Ib3f79dd53e96c8f6d40c9c6614db5c672f24ba97
Diffstat (limited to 'solenv/bin')
-rwxr-xr-x | solenv/bin/mkdocs.sh | 16 |
1 files changed, 10 insertions, 6 deletions
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" |