Skip to content

Commit 056fd76

Browse files
authored
Update build.cs
use SearchOption.AllDirectories
1 parent a38706f commit 056fd76

File tree

1 file changed

+1
-14
lines changed

1 file changed

+1
-14
lines changed

build.cs

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,9 @@
11
var root = Directory.GetCurrentDirectory();
2-
foreach (var scripts in GetScripts(root))
2+
foreach (var scripts in Directory.GetFiles(root, "*.cs", SearchOption.AllDirectories))
33
{
44
foreach (var script in scripts)
55
{
66
Console.WriteLine($"Compile script {script} test");
77
CommandExecutor.ExecuteCommandAndOutput($"dotnet-exec {script} --dry-run").EnsureSuccessExitCode();
88
}
99
}
10-
11-
IEnumerable<string[]> GetScripts(string root)
12-
{
13-
foreach (var dir in Directory.GetDirectories(root))
14-
{
15-
yield return Directory.GetFiles(dir, "*.cs");
16-
17-
foreach (var scripts in GetScripts(dir))
18-
{
19-
yield return scripts;
20-
}
21-
}
22-
}

0 commit comments

Comments
 (0)