Skip to content

Commit

Permalink
Merge pull request #71 from openziti/fix-appetizer-sample
Browse files Browse the repository at this point in the history
tweak appetizer sample
  • Loading branch information
dovholuknf authored Apr 19, 2024
2 parents 0c222dc + 135067c commit 7071f92
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
3 changes: 3 additions & 0 deletions OpenZiti.NET.Samples/src/Appetizer/AppetizerSample.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ public class AppetizerSample : SampleBase {

public override async Task<object> RunAsync(string[] args) {
Log.Info("Appetizer reflect demo starts");
if (args.Length < 2) {
throw new Exception("sample expects two params: <sample to execute> <identity file to use>");
}
var zitiContext = AppetizerSetup.ContextFromFile(args[1]);
using Stream stream = ZitifiedNetworkStream.NewStream(zitiContext, REFLECT_SERVICE_NAME, null);
using var reader = new StreamReader(stream, Encoding.ASCII);
Expand Down
1 change: 1 addition & 0 deletions OpenZiti.NET.Samples/src/Common/SampleSetup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public class SampleSetup {
public static bool Initialize { get; set; } = true;

private static string _idFile;

public static string IdentityFile {
get {
if (Initialize) { return null; }
Expand Down
2 changes: 0 additions & 2 deletions OpenZiti.NET.Samples/src/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ private static async Task Main(string[] args) {
if ( args[0].Contains(AppDomain.CurrentDomain.FriendlyName )) {
Console.WriteLine("args[0] contains the AppDomain.CurrentDomain.FriendlyName, must be using dotnet run.");
args = args.Skip(1).ToArray();
} else {
Console.WriteLine(AppDomain.CurrentDomain.FriendlyName);
}

if (args.Length > 1) {
Expand Down

0 comments on commit 7071f92

Please sign in to comment.