Skip to content

Commit 3cc9799

Browse files
authored
Treat service directory as single scope (#15114)
* Treat service directory as single scope Relates to #14969 * Resolve PR feedback
1 parent 45d0f7f commit 3cc9799

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

eng/SnippetGenerator/Program.cs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ public class Program
1919
public void OnExecuteAsync()
2020
{
2121
var baseDirectory = new DirectoryInfo(BasePath).Name;
22-
var baseDirParent = Directory.GetParent(BasePath).Name;
23-
if (baseDirectory.Equals("sdk") || baseDirParent.Equals("sdk"))
22+
if (baseDirectory.Equals("sdk"))
2423
{
2524
Parallel.ForEach(Directory.GetDirectories(BasePath), sdkDir => new DirectoryProcessor(sdkDir).Process());
2625
}
@@ -32,16 +31,23 @@ public void OnExecuteAsync()
3231

3332
public static int Main(string[] args)
3433
{
34+
ConsoleColor foreground = Console.ForegroundColor;
35+
3536
try
3637
{
3738
return CommandLineApplication.Execute<Program>(args);
3839
}
3940
catch (Exception e)
4041
{
42+
Console.ForegroundColor = ConsoleColor.Red;
43+
4144
Console.Error.WriteLine(e.ToString());
4245
return 1;
4346
}
44-
47+
finally
48+
{
49+
Console.ForegroundColor = foreground;
50+
}
4551
}
4652
}
4753
}

0 commit comments

Comments
 (0)