Skip to content

Commit 8411ae6

Browse files
committed
Improve test script error-handling
1 parent e24284b commit 8411ae6

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

test.cmd

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
@echo off
22
setlocal
33
pushd "%~dp0"
4-
if not defined CI dotnet pack
4+
if not defined CI dotnet pack || goto :finally
5+
set INSTALLED=
56
dotnet new --install src\ConsoleApp || goto :finally
7+
set INSTALLED=1
68
dotnet new docopt-console -o tmp -n MyConsoleApp || goto :finally
79
dotnet run --project tmp -- --help || goto :finally
810
:finally
911
set EXIT_CODE=%ERRORLEVEL%
1012
if exist tmp rmdir /s /q tmp
11-
dotnet new --uninstall src\ConsoleApp
13+
if defined INSTALLED dotnet new --uninstall src\ConsoleApp
1214
popd
1315
exit /b %EXIT_CODE%

0 commit comments

Comments
 (0)