I often find myself in the situation of looking for files matching a certain pattern within a folder or below.
Here is a typical use case
As of today, executing dotnet test on a solution will try to find and execute tests on every project filling the log with errors because no testable project was found. This is why I prefer to find every project file within the tests directory hive.
I am aware that the same functionality is offered by IFileSystem but the result of IFileSystem.GetFiles is a list of IFile instead of FilePath. This is not convenient since most of the aliases work with FilePath.
The text was updated successfully, but these errors were encountered:
The name indicates that it returns files and not file paths. Perhaps it should be renamed to something like GetFilePaths instead?
I'm also curious to why this method takes a DirectoryPath, pattern and SearchScope instead of a glob pattern, such as $"{testDirectory}/**/*.csproj". This would be more constistent with the GetFiles alias that already exist.
I didn't like that I had to write GetFiles(testDirectory.FullPath + "/**/*.csproj"), but I didn't know that GetFiles($"{testDirectory}/**/*.csproj") is supported.
I often find myself in the situation of looking for files matching a certain pattern within a folder or below.
Here is a typical use case
As of today, executing
dotnet teston a solution will try to find and execute tests on every project filling the log with errors because no testable project was found. This is why I prefer to find every project file within thetestsdirectory hive.I am aware that the same functionality is offered by
IFileSystembut the result ofIFileSystem.GetFilesis a list ofIFileinstead ofFilePath. This is not convenient since most of the aliases work withFilePath.The text was updated successfully, but these errors were encountered: