From 74a40de6e744e3401f868aa1ecb03ea757fa3c2c Mon Sep 17 00:00:00 2001 From: Heath Stewart Date: Fri, 11 Sep 2020 15:20:46 -0700 Subject: [PATCH 1/2] Treat service directory as single scope Relates to #14969 --- eng/SnippetGenerator/Program.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/eng/SnippetGenerator/Program.cs b/eng/SnippetGenerator/Program.cs index 803f7f3ddc63..95f6724116a3 100644 --- a/eng/SnippetGenerator/Program.cs +++ b/eng/SnippetGenerator/Program.cs @@ -20,7 +20,7 @@ public void OnExecuteAsync() { var baseDirectory = new DirectoryInfo(BasePath).Name; var baseDirParent = Directory.GetParent(BasePath).Name; - if (baseDirectory.Equals("sdk") || baseDirParent.Equals("sdk")) + if (baseDirectory.Equals("sdk")) { Parallel.ForEach(Directory.GetDirectories(BasePath), sdkDir => new DirectoryProcessor(sdkDir).Process()); } @@ -32,16 +32,23 @@ public void OnExecuteAsync() public static int Main(string[] args) { + ConsoleColor foreground = Console.ForegroundColor; + try { return CommandLineApplication.Execute(args); } catch (Exception e) { + Console.ForegroundColor = ConsoleColor.Red; + Console.Error.WriteLine(e.ToString()); return 1; } - + finally + { + Console.ForegroundColor = foreground; + } } } } From 53179048fcf4330952745e068e4cce110d56ca28 Mon Sep 17 00:00:00 2001 From: Heath Stewart Date: Fri, 11 Sep 2020 15:38:27 -0700 Subject: [PATCH 2/2] Resolve PR feedback --- eng/SnippetGenerator/Program.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/eng/SnippetGenerator/Program.cs b/eng/SnippetGenerator/Program.cs index 95f6724116a3..075bae32422f 100644 --- a/eng/SnippetGenerator/Program.cs +++ b/eng/SnippetGenerator/Program.cs @@ -19,7 +19,6 @@ public class Program public void OnExecuteAsync() { var baseDirectory = new DirectoryInfo(BasePath).Name; - var baseDirParent = Directory.GetParent(BasePath).Name; if (baseDirectory.Equals("sdk")) { Parallel.ForEach(Directory.GetDirectories(BasePath), sdkDir => new DirectoryProcessor(sdkDir).Process());