Skip to content

Commit b7baf1d

Browse files
authored
check for directories under windows artifacts (#14)
* Add code to check directories for executables
1 parent 33e10ca commit b7baf1d

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

Tasks/TestWindowsTask.cs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,18 @@ public override void Run(BuildContext context)
3030
{
3131
var vswhere = new VSWhereLatest(context.FileSystem, context.Environment, context.ProcessRunner, context.Tools);
3232
var devcmdPath = vswhere.Latest(new VSWhereLatestSettings()).FullPath + @"\Common7\Tools\vsdevcmd.bat";
33+
CheckDir(context, devcmdPath, context.ArtifactsDir);
34+
}
3335

34-
35-
// Ensure there are files to test otherwise this will always pass
36-
var files = Directory.GetFiles(context.ArtifactsDir);
37-
if (files is null || files.Length == 0)
36+
private void CheckDir(BuildContext context, string devcmdPath, string dir)
37+
{
38+
foreach (var dirPath in Directory.GetDirectories(dir))
3839
{
39-
throw new Exception("There are no files in the artifacts directory to test");
40+
CheckDir(context, devcmdPath, dirPath);
4041
}
4142

43+
// Ensure there are files to test otherwise this will always pass
44+
var files = Directory.GetFiles(context.ArtifactsDir);
4245
foreach (var filePath in files)
4346
{
4447
context.Information($"Checking: {filePath}");

0 commit comments

Comments
 (0)