Skip to content

Commit 30fe458

Browse files
committed
Allowed exit on Sample app for build.
1 parent a201884 commit 30fe458

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

build.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@ for path in test/*.Tests/*.csproj; do
1313
done
1414

1515
cd sample/Sample/
16-
dotnet run -f netcoreapp2.0 -c Release
16+
dotnet build -f netcoreapp2.0 -c Release
17+
dotnet bin/Release/netcoreapp2.0/Sample.dll --run-once

sample/Sample/Program.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
using Microsoft.Extensions.Configuration;
44
using Serilog;
55
using System.IO;
6-
6+
using System.Linq;
77
using Serilog.Core;
88
using Serilog.Events;
99

@@ -22,6 +22,8 @@ public static void Main(string[] args)
2222
.ReadFrom.Configuration(configuration)
2323
.CreateLogger();
2424

25+
logger.Information("Args: {a}", args);
26+
2527
do
2628
{
2729
logger.ForContext<Program>().Information("Hello, world!");
@@ -32,7 +34,7 @@ public static void Main(string[] args)
3234

3335
Console.WriteLine();
3436
}
35-
while (Console.ReadKey().KeyChar != 'q');
37+
while (!args.Contains("--run-once") && (Console.ReadKey().KeyChar != 'q'));
3638
}
3739
}
3840

0 commit comments

Comments
 (0)