2021-10-25 21:49:17 +00:00
|
|
|
@ECHO off
|
|
|
|
SETLOCAL enableextensions enabledelayedexpansion
|
|
|
|
PUSHD .
|
|
|
|
CD /d "%~dp0\.."
|
|
|
|
|
|
|
|
REM --------------------------------------------------------------------------------------
|
2021-11-03 16:19:48 +00:00
|
|
|
REM Runs clang format on all the C++ files in the project
|
2021-10-25 21:49:17 +00:00
|
|
|
REM --------------------------------------------------------------------------------------
|
|
|
|
|
2021-11-03 16:19:48 +00:00
|
|
|
WHERE /Q clang-format
|
|
|
|
IF %ERRORLEVEL% NEQ 0 (
|
|
|
|
ECHO Could not find clang-format
|
|
|
|
PAUSE
|
|
|
|
POPD
|
|
|
|
ENDLOCAL
|
|
|
|
EXIT /B %ERRORLEVEL%
|
|
|
|
)
|
|
|
|
|
2021-10-25 21:49:17 +00:00
|
|
|
CALL :RunClangFormatOnDirectories ^
|
|
|
|
include\toml++ ^
|
|
|
|
include\toml++\impl ^
|
2021-10-26 13:49:23 +00:00
|
|
|
tests ^
|
2021-10-25 21:49:17 +00:00
|
|
|
examples
|
|
|
|
|
2021-11-03 16:19:48 +00:00
|
|
|
POPD
|
|
|
|
@ENDLOCAL
|
|
|
|
EXIT /B 0
|
2021-10-25 21:49:17 +00:00
|
|
|
|
|
|
|
:RunClangFormatOnDirectories
|
|
|
|
(
|
|
|
|
FOR %%i IN (%*) DO (
|
|
|
|
IF EXIST "%%~i" (
|
|
|
|
ECHO Formatting files in "%%~i"
|
|
|
|
clang-format --style=file -i "%%~i\*.cpp" >nul 2>&1
|
|
|
|
clang-format --style=file -i "%%~i\*.h" >nul 2>&1
|
|
|
|
clang-format --style=file -i "%%~i\*.inl" >nul 2>&1
|
|
|
|
)
|
|
|
|
)
|
|
|
|
EXIT /B
|
|
|
|
)
|