GlobbingExtensions.

GetMatchingFiles(ICakeContext, IEnumerable<FilePath>) Method

Summary

Returns files in the same directory that have the same file name but different extensions

Syntax

public static FilePathCollection GetMatchingFiles(this ICakeContext context, IEnumerable<FilePath> files)

Examples

Locates files with the same name in the same directory, but different extensions. The .pdb to your .dll as it were. If found, returns the original file as well.
 // /output/file.dll
 // /output/file.xml
 // /output/file.pdb
 // /output/another.dll

 FilePathCollection matchingFiles = GetMatchingFiles(new FilePath("/output/file.dll"));

 matchingFiles.First(); // /output/file.xml
 matchingFiles.Skip(1).First(); // /output/file.pdb
 matchingFiles.Last(); // /output/file.dll

Attributes

Type Description
CakeMethodAliasAttribute
CakeAliasCategoryAttribute

Parameters

Name Type Description
context ICakeContext the cake context
files IEnumerable<FilePath> the files to return matches for

Return Value

Type Description
FilePathCollection a list of matching files