From 9edba505b5263cfab4f6ac97832834b93c624439 Mon Sep 17 00:00:00 2001 From: David Farrell Date: Tue, 3 Nov 2020 09:16:14 -0800 Subject: [PATCH] Adds better support for .bat files; Fixes docs/make.bat --- .gitattributes | 3 ++ .pre-commit-config.yaml | 1 + docs/make.bat | 70 ++++++++++++++++++++--------------------- 3 files changed, 39 insertions(+), 35 deletions(-) diff --git a/.gitattributes b/.gitattributes index d4c710cb..bb7d1461 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,2 +1,5 @@ *.sh text eol=lf *.bash text eol=lf + +# Windows files +*.bat text eol=crlf diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0a7ab794..0bd696da 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -25,3 +25,4 @@ repos: hooks: # - id: forbid-crlf - id: remove-crlf + exclude: ".bat$" diff --git a/docs/make.bat b/docs/make.bat index 2119f510..922152e9 100644 --- a/docs/make.bat +++ b/docs/make.bat @@ -1,35 +1,35 @@ -@ECHO OFF - -pushd %~dp0 - -REM Command file for Sphinx documentation - -if "%SPHINXBUILD%" == "" ( - set SPHINXBUILD=sphinx-build -) -set SOURCEDIR=. -set BUILDDIR=_build - -if "%1" == "" goto help - -%SPHINXBUILD% >NUL 2>NUL -if errorlevel 9009 ( - echo. - echo.The 'sphinx-build' command was not found. Make sure you have Sphinx - echo.installed, then set the SPHINXBUILD environment variable to point - echo.to the full path of the 'sphinx-build' executable. Alternatively you - echo.may add the Sphinx directory to PATH. - echo. - echo.If you don't have Sphinx installed, grab it from - echo.http://sphinx-doc.org/ - exit /b 1 -) - -%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% -goto end - -:help -%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% - -:end -popd +@ECHO OFF + +pushd %~dp0 + +REM Command file for Sphinx documentation + +if "%SPHINXBUILD%" == "" ( + set SPHINXBUILD=sphinx-build +) +set SOURCEDIR=. +set BUILDDIR=_build + +if "%1" == "" goto help + +%SPHINXBUILD% >NUL 2>NUL +if errorlevel 9009 ( + echo. + echo.The 'sphinx-build' command was not found. Make sure you have Sphinx + echo.installed, then set the SPHINXBUILD environment variable to point + echo.to the full path of the 'sphinx-build' executable. Alternatively you + echo.may add the Sphinx directory to PATH. + echo. + echo.If you don't have Sphinx installed, grab it from + echo.http://sphinx-doc.org/ + exit /b 1 +) + +%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% +goto end + +:help +%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% + +:end +popd