-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathformat.bat
More file actions
45 lines (39 loc) · 1.27 KB
/
Copy pathformat.bat
File metadata and controls
45 lines (39 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
@echo off
setlocal
REM ========================================
REM dotnet format helper script
REM Usage:
REM format -> runs both (default)
REM format both -> runs both
REM format style -> runs style only
REM format whitespace -> runs whitespace only
REM ========================================
set PROJECT=./Wg-backend-api/Wg-backend-api.csproj
set MODE=%1
if "%MODE%"=="" set MODE=both
echo ----------------------------------------
echo Running dotnet format for project: %PROJECT%
echo Mode: %MODE%
echo ----------------------------------------
if /I "%MODE%"=="both" (
echo Formatting style...
dotnet format style "%PROJECT%" --exclude ./Wg-backend-api/Program.cs
echo.
echo Formatting whitespace...
dotnet format whitespace "%PROJECT%" --exclude ./Wg-backend-api/Program.cs
) else if /I "%MODE%"=="style" (
echo Formatting style only...
dotnet format style "%PROJECT%" --exclude ./Wg-backend-api/Program.cs
) else if /I "%MODE%"=="whitespace" (
echo Formatting whitespace only...
dotnet format whitespace "%PROJECT%" --exclude ./Wg-backend-api/Program.cs
) else (
echo Invalid option: %MODE%
echo.
echo Usage:
echo format.bat [both^|style^|whitespace]
exit /b 1
)
echo.
echo Done.
endlocal