diff --git a/build.sh b/build.sh index 6fd90fec8da..153786fed68 100755 --- a/build.sh +++ b/build.sh @@ -18,5 +18,9 @@ fi # Prettify `search_index.json` after `mkdocs` # `mkdocs` removed its own prettify few years ago: https://github.com/mkdocs/mkdocs/pull/1128 -python -m json.tool ./site/search/search_index.json >./site/search/search_index_new.json +if type python3 >/dev/null 2>/dev/null; then + python3 -m json.tool ./site/search/search_index.json >./site/search/search_index_new.json +else + python -m json.tool ./site/search/search_index.json >./site/search/search_index_new.json +fi mv -f -- ./site/search/search_index_new.json ./site/search/search_index.json