Initial commit
This commit is contained in:
30
format.bat
Normal file
30
format.bat
Normal file
@@ -0,0 +1,30 @@
|
||||
@echo off
|
||||
REM Variable that will hold the name of the clang-format command
|
||||
SET FMT=clang-format
|
||||
|
||||
REM Function to format files
|
||||
:format
|
||||
for /r %%f in (*.h *.m *.mm *.c *.cpp) do (
|
||||
echo %%~nxf | findstr /i "_generated.h$" >nul
|
||||
if errorlevel 1 (
|
||||
echo format %%f
|
||||
%FMT% -i "%%f"
|
||||
)
|
||||
)
|
||||
echo ~~~ %1 Done ~~~
|
||||
exit /b
|
||||
|
||||
REM Check if argument is provided
|
||||
if "%1"=="" (
|
||||
echo Please provide a directory as an argument.
|
||||
exit /b
|
||||
)
|
||||
|
||||
REM Check if directory exists
|
||||
if not exist "%1" (
|
||||
echo %1 is not a valid directory.
|
||||
exit /b
|
||||
)
|
||||
|
||||
cd %1
|
||||
call :format
|
||||
Reference in New Issue
Block a user