@@ -58,7 +58,7 @@ if "%1" EQU "help" goto help
5858if " %1 " EQU " check" goto check
5959if " %1 " EQU " serve" goto serve
6060if " %1 " == " clean" (
61- rmdir /q /s %BUILDDIR%
61+ rmdir /q /s " %BUILDDIR% "
6262 goto end
6363)
6464
@@ -107,6 +107,8 @@ echo.be passed by setting the SPHINXOPTS environment variable.
107107goto end
108108
109109:build
110+ if not exist " %BUILDDIR% " mkdir " %BUILDDIR% "
111+
110112if exist ..\Misc\NEWS (
111113 echo .Copying Misc\NEWS to build\NEWS
112114 copy ..\Misc\NEWS build\NEWS > nul
@@ -123,10 +125,10 @@ if exist ..\Misc\NEWS (
123125if NOT " %PAPER% " == " " (
124126 set SPHINXOPTS = -D latex_elements.papersize=%PAPER% %SPHINXOPTS%
125127)
126- cmd /C %SPHINXBUILD% %SPHINXOPTS% -b%1 -dbuild\doctrees . %BUILDDIR% \%*
128+ cmd /S /C " %SPHINXBUILD% %SPHINXOPTS% -b%1 -dbuild\doctrees . " %BUILDDIR% \%1 " %2 %3 %4 %5 %6 %7 %8 %9 "
127129
128130if " %1 " EQU " htmlhelp" (
129- cmd /C " %HTMLHELP% " build \htmlhelp\python%DISTVERSION:. =% .hhp
131+ " %HTMLHELP% " " %BUILDDIR% \htmlhelp\python%DISTVERSION:. =% .hhp"
130132 rem hhc.exe seems to always exit with code 1, reset to 0 for less than 2
131133 if not errorlevel 2 cmd /C exit /b 0
132134)
@@ -146,19 +148,19 @@ if NOT "%2" EQU "" (
146148)
147149cmd /C %this% html
148150
149- if EXIST %BUILDDIR% \html\index.html (
150- echo .Opening %BUILDDIR% \html\index.html in the default web browser...
151- start %BUILDDIR% \html\index.html
151+ if EXIST " %BUILDDIR% \html\index.html" (
152+ echo .Opening " %BUILDDIR% \html\index.html" in the default web browser...
153+ start " %BUILDDIR% \html\index.html"
152154)
153155
154156goto end
155157
156158:check
157- cmd /C %PYTHON% tools\rstlint.py -i tools
159+ cmd /S /C " %PYTHON% tools\rstlint.py -i tools"
158160goto end
159161
160162:serve
161- cmd /C %PYTHON% ..\Tools\scripts\serve.py %BUILDDIR% \html
163+ cmd /S /C " %PYTHON% ..\Tools\scripts\serve.py " %BUILDDIR% \html" "
162164goto end
163165
164166:end
0 commit comments