Georg Brandl avatar Georg Brandl committed 8e4edcb

#522: in Windows batchfile, do not print success message when sphinx-build fails.

Comments (0)

Files changed (1)

sphinx/quickstart.py

 
 if "%%1" == "html" (
 \t%%SPHINXBUILD%% -b html %%ALLSPHINXOPTS%% %%BUILDDIR%%/html
+\tif errorlevel 1 exit /b 1
 \techo.
 \techo.Build finished. The HTML pages are in %%BUILDDIR%%/html.
 \tgoto end
 
 if "%%1" == "dirhtml" (
 \t%%SPHINXBUILD%% -b dirhtml %%ALLSPHINXOPTS%% %%BUILDDIR%%/dirhtml
+\tif errorlevel 1 exit /b 1
 \techo.
 \techo.Build finished. The HTML pages are in %%BUILDDIR%%/dirhtml.
 \tgoto end
 
 if "%%1" == "singlehtml" (
 \t%%SPHINXBUILD%% -b singlehtml %%ALLSPHINXOPTS%% %%BUILDDIR%%/singlehtml
+\tif errorlevel 1 exit /b 1
 \techo.
 \techo.Build finished. The HTML pages are in %%BUILDDIR%%/singlehtml.
 \tgoto end
 
 if "%%1" == "pickle" (
 \t%%SPHINXBUILD%% -b pickle %%ALLSPHINXOPTS%% %%BUILDDIR%%/pickle
+\tif errorlevel 1 exit /b 1
 \techo.
 \techo.Build finished; now you can process the pickle files.
 \tgoto end
 
 if "%%1" == "json" (
 \t%%SPHINXBUILD%% -b json %%ALLSPHINXOPTS%% %%BUILDDIR%%/json
+\tif errorlevel 1 exit /b 1
 \techo.
 \techo.Build finished; now you can process the JSON files.
 \tgoto end
 
 if "%%1" == "htmlhelp" (
 \t%%SPHINXBUILD%% -b htmlhelp %%ALLSPHINXOPTS%% %%BUILDDIR%%/htmlhelp
+\tif errorlevel 1 exit /b 1
 \techo.
 \techo.Build finished; now you can run HTML Help Workshop with the ^
 .hhp project file in %%BUILDDIR%%/htmlhelp.
 
 if "%%1" == "qthelp" (
 \t%%SPHINXBUILD%% -b qthelp %%ALLSPHINXOPTS%% %%BUILDDIR%%/qthelp
+\tif errorlevel 1 exit /b 1
 \techo.
 \techo.Build finished; now you can run "qcollectiongenerator" with the ^
 .qhcp project file in %%BUILDDIR%%/qthelp, like this:
 
 if "%%1" == "devhelp" (
 \t%%SPHINXBUILD%% -b devhelp %%ALLSPHINXOPTS%% %%BUILDDIR%%/devhelp
+\tif errorlevel 1 exit /b 1
 \techo.
 \techo.Build finished.
 \tgoto end
 
 if "%%1" == "epub" (
 \t%%SPHINXBUILD%% -b epub %%ALLSPHINXOPTS%% %%BUILDDIR%%/epub
+\tif errorlevel 1 exit /b 1
 \techo.
 \techo.Build finished. The epub file is in %%BUILDDIR%%/epub.
 \tgoto end
 
 if "%%1" == "latex" (
 \t%%SPHINXBUILD%% -b latex %%ALLSPHINXOPTS%% %%BUILDDIR%%/latex
+\tif errorlevel 1 exit /b 1
 \techo.
 \techo.Build finished; the LaTeX files are in %%BUILDDIR%%/latex.
 \tgoto end
 
 if "%%1" == "text" (
 \t%%SPHINXBUILD%% -b text %%ALLSPHINXOPTS%% %%BUILDDIR%%/text
+\tif errorlevel 1 exit /b 1
 \techo.
 \techo.Build finished. The text files are in %%BUILDDIR%%/text.
 \tgoto end
 
 if "%%1" == "man" (
 \t%%SPHINXBUILD%% -b man %%ALLSPHINXOPTS%% %%BUILDDIR%%/man
+\tif errorlevel 1 exit /b 1
 \techo.
 \techo.Build finished. The manual pages are in %%BUILDDIR%%/man.
 \tgoto end
 
 if "%%1" == "changes" (
 \t%%SPHINXBUILD%% -b changes %%ALLSPHINXOPTS%% %%BUILDDIR%%/changes
+\tif errorlevel 1 exit /b 1
 \techo.
 \techo.The overview file is in %%BUILDDIR%%/changes.
 \tgoto end
 
 if "%%1" == "linkcheck" (
 \t%%SPHINXBUILD%% -b linkcheck %%ALLSPHINXOPTS%% %%BUILDDIR%%/linkcheck
+\tif errorlevel 1 exit /b 1
 \techo.
 \techo.Link check complete; look for any errors in the above output ^
 or in %%BUILDDIR%%/linkcheck/output.txt.
 
 if "%%1" == "doctest" (
 \t%%SPHINXBUILD%% -b doctest %%ALLSPHINXOPTS%% %%BUILDDIR%%/doctest
+\tif errorlevel 1 exit /b 1
 \techo.
 \techo.Testing of doctests in the sources finished, look at the ^
 results in %%BUILDDIR%%/doctest/output.txt.
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.