diff --git a/eng/SnippetGenerator/Program.cs b/eng/SnippetGenerator/Program.cs index 803f7f3ddc639..075bae32422f5 100644 --- a/eng/SnippetGenerator/Program.cs +++ b/eng/SnippetGenerator/Program.cs @@ -19,8 +19,7 @@ public class Program 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 +31,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; + } } } }