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