GlobberExtensions.

GetFileSystemInfos(IGlobber, IFileSystem, GlobPattern, GlobberSettings) Method

Summary

Gets all files and directories matching the specified pattern. Scripts and Frosting should use the GetFileSystemInfos(pattern) alias in Cake.Common instead, which supplies the file system from the context.
Namespace
Cake.Core.IO
Containing Type
GlobberExtensions

Syntax

public static IEnumerable<IFileSystemInfo> GetFileSystemInfos(this IGlobber globber, IFileSystem fileSystem, GlobPattern pattern, GlobberSettings settings)

Examples

 Func<IFileSystemInfo, bool> exclude_node_modules =
     fileSystemInfo => !fileSystemInfo.Path.FullPath.EndsWith(
         "node_modules", StringComparison.OrdinalIgnoreCase);

 var entries = context.Globber.GetFileSystemInfos(
     context.FileSystem,
     "./src/**/*",
     new GlobberSettings { Predicate = exclude_node_modules });
 foreach (var entry in entries)
 {
     Information("{0}: {1}", entry is IDirectory ? "Directory" : "File", entry.Path);
 }

Parameters

Name Type Description
globber IGlobber The globber.
fileSystem IFileSystem The file system.
pattern GlobPattern The pattern.
settings GlobberSettings The globber settings.

Return Value

Type Description
IEnumerable<IFileSystemInfo> The file system entries matching the specified pattern.