Skip to content

Commit d5cd21d

Browse files
authored
Fixes doc/make.bat to properly handle quoted paths. (#3302)
1 parent 14ce158 commit d5cd21d

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

Doc/make.bat

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,18 @@ pushd %~dp0
66
set this=%~n0
77

88
call ..\PCBuild\find_python.bat %PYTHON%
9-
if "%SPHINXBUILD%" EQU "" if "%PYTHON%" NEQ "" (
10-
set SPHINXBUILD=%PYTHON%\..\Scripts\sphinx-build.exe
11-
rem Cannot use %SPHINXBUILD% in the same block where we set it
12-
if not exist "%PYTHON%\..\Scripts\sphinx-build.exe" (
9+
if not defined SPHINXBUILD if defined PYTHON (
10+
%PYTHON% -c "import sphinx" > nul 2> nul
11+
if errorlevel 1 (
1312
echo Installing sphinx with %PYTHON%
14-
"%PYTHON%" -m pip install sphinx
13+
%PYTHON% -m pip install sphinx
1514
if errorlevel 1 exit /B
1615
)
16+
set SPHINXBUILD=%PYTHON% -c "import sphinx, sys; sys.argv[0] = 'sphinx-build'; sphinx.main()"
1717
)
1818

19-
if "%PYTHON%" EQU "" set PYTHON=py
20-
if "%SPHINXBUILD%" EQU "" set SPHINXBUILD=sphinx-build
19+
if not defined PYTHON set PYTHON=py
20+
if not defined SPHINXBUILD set SPHINXBUILD=sphinx-build
2121

2222
if "%1" NEQ "htmlhelp" goto :skiphhcsearch
2323
if exist "%HTMLHELP%" goto :skiphhcsearch
@@ -99,7 +99,7 @@ goto end
9999
if NOT "%PAPER%" == "" (
100100
set SPHINXOPTS=-D latex_elements.papersize=%PAPER% %SPHINXOPTS%
101101
)
102-
cmd /C %SPHINXBUILD% %SPHINXOPTS% -b%1 -dbuild\doctrees . %BUILDDIR%\%*
102+
cmd /C "%SPHINXBUILD% %SPHINXOPTS% -b%1 -dbuild\doctrees . %BUILDDIR%\%*"
103103

104104
if "%1" EQU "htmlhelp" (
105105
cmd /C "%HTMLHELP%" build\htmlhelp\python%DISTVERSION:.=%.hhp

0 commit comments

Comments
 (0)