-
-
Notifications
You must be signed in to change notification settings - Fork 63
Fix match path on cmd prompt #719
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
5cb37c3
04918bd
62688fc
8ca0caf
92c55b9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,215 @@ | ||||||||||||
| @echo off | ||||||||||||
| setlocal enabledelayedexpansion | ||||||||||||
|
|
||||||||||||
| :: Parse command line arguments | ||||||||||||
| set "PARALLEL=true" | ||||||||||||
| set "USE_PRODUCTION=false" | ||||||||||||
|
|
||||||||||||
| :parse_args | ||||||||||||
| if "%~1"=="" goto :main | ||||||||||||
| if /i "%~1"=="-parallel" ( | ||||||||||||
| set "PARALLEL=%~2" | ||||||||||||
| shift | ||||||||||||
| shift | ||||||||||||
| goto :parse_args | ||||||||||||
| ) | ||||||||||||
| if /i "%~1"=="-useproduction" ( | ||||||||||||
| set "USE_PRODUCTION=true" | ||||||||||||
| shift | ||||||||||||
| goto :parse_args | ||||||||||||
| ) | ||||||||||||
| shift | ||||||||||||
| goto :parse_args | ||||||||||||
|
|
||||||||||||
| :main | ||||||||||||
| echo Parallel: %PARALLEL% | ||||||||||||
| echo UseProduction: %USE_PRODUCTION% | ||||||||||||
|
|
||||||||||||
| goto :run_tests | ||||||||||||
|
|
||||||||||||
| :throw_on_native_failure | ||||||||||||
| if not %errorlevel%==0 ( | ||||||||||||
| echo Native Failure | ||||||||||||
| exit /b 1 | ||||||||||||
| ) | ||||||||||||
| goto :eof | ||||||||||||
|
|
||||||||||||
| :generate_and_build | ||||||||||||
| set "format=%~1" | ||||||||||||
| set "namespace=%~2" | ||||||||||||
| set "output_path=%~3" | ||||||||||||
| set "args=%~4" | ||||||||||||
| set "net_core=%~5" | ||||||||||||
| set "csproj=%~6" | ||||||||||||
| set "build_from_source=%~7" | ||||||||||||
|
|
||||||||||||
| if "%build_from_source%"=="" set "build_from_source=true" | ||||||||||||
|
|
||||||||||||
| :: Clean up generated files | ||||||||||||
| del /q /s ".\GeneratedCode\*.cs" 2>nul | ||||||||||||
|
|
||||||||||||
| set "process_path=.\bin\refitter" | ||||||||||||
| if /i "%build_from_source%"=="false" set "process_path=refitter" | ||||||||||||
|
|
||||||||||||
| :: Check if using settings file | ||||||||||||
| echo %args% | findstr "settings-file" >nul | ||||||||||||
| if %errorlevel%==0 ( | ||||||||||||
| echo %process_path% --no-logging %args% | ||||||||||||
| %process_path% --no-logging %args% | ||||||||||||
| call :throw_on_native_failure | ||||||||||||
| ) else ( | ||||||||||||
| echo %process_path% .\openapi.%format% --namespace %namespace% --output .\GeneratedCode\%output_path% --no-logging %args% | ||||||||||||
| %process_path% .\openapi.%format% --namespace %namespace% --output .\GeneratedCode\%output_path% --no-logging %args% | ||||||||||||
| call :throw_on_native_failure | ||||||||||||
| ) | ||||||||||||
|
|
||||||||||||
| :: Build the project | ||||||||||||
| if not "%csproj%"=="" ( | ||||||||||||
| echo. | ||||||||||||
| echo Building %csproj% file | ||||||||||||
| echo. | ||||||||||||
| set "solution=%csproj%" | ||||||||||||
| ) else ( | ||||||||||||
| echo. | ||||||||||||
| echo Building ConsoleApp | ||||||||||||
| echo. | ||||||||||||
| set "solution=.\ConsoleApp\ConsoleApp.sln" | ||||||||||||
| if /i "%net_core%"=="true" set "solution=.\ConsoleApp\ConsoleApp.Core.sln" | ||||||||||||
| ) | ||||||||||||
|
|
||||||||||||
| dotnet build %solution% | ||||||||||||
| call :throw_on_native_failure | ||||||||||||
| goto :eof | ||||||||||||
|
|
||||||||||||
| :run_tests | ||||||||||||
| set "method=%~1" | ||||||||||||
| set "parallel_param=%~2" | ||||||||||||
|
||||||||||||
| set "build_from_source_param=%~3" | ||||||||||||
|
Comment on lines
+85
to
+87
|
||||||||||||
| set "method=%~1" | |
| set "parallel_param=%~2" | |
| set "build_from_source_param=%~3" | |
| set "parallel_param=%~1" | |
| set "build_from_source_param=%~2" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider writing warning messages to the error stream using Console.Error.WriteLine so they’re clearly distinguished from normal output and can be redirected separately.