From fb3de038561ad63e4cf2844dd75ef6fa87f5c541 Mon Sep 17 00:00:00 2001 From: anatoly techtonik Date: Wed, 12 Feb 2014 13:44:29 +0300 Subject: [PATCH] make.bat: Try to find Sphinx through Python if it can not be found --- sphinx/quickstart.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sphinx/quickstart.py b/sphinx/quickstart.py index a57006fd0..390415ee3 100644 --- a/sphinx/quickstart.py +++ b/sphinx/quickstart.py @@ -646,6 +646,14 @@ if "%%1" == "clean" ( ) +REM Check if sphinx-build is available and fallback to Python version if any +%%SPHINXBUILD%% 2> nul +if errorlevel 9009 goto sphinx_python +goto sphinx_ok + +:sphinx_python + +set SPHINXBUILD=python -m sphinx.__init__ %%SPHINXBUILD%% 2> nul if errorlevel 9009 ( \techo. @@ -659,6 +667,9 @@ if errorlevel 9009 ( \texit /b 1 ) +:sphinx_ok + + if "%%1" == "html" ( \t%%SPHINXBUILD%% -b html %%ALLSPHINXOPTS%% %%BUILDDIR%%/html \tif errorlevel 1 exit /b 1