DirectoryAliases.

CleanDirectories(ICakeContext, GlobPattern, Func<IFileSystemInfo, bool>, CleanDirectorySettings) Method

Summary

Cleans the directories matching the specified pattern. Cleaning the directory will remove all its content but not the directory itself.
Namespace
Cake.Common.IO
Containing Type
DirectoryAliases

Syntax

[CakeMethodAlias]
[CakeAliasCategory("Clean")]
public static void CleanDirectories(this ICakeContext context, GlobPattern pattern, Func<IFileSystemInfo, bool> predicate, CleanDirectorySettings settings)

Examples

Func<IFileSystemInfo, bool> exclude_node_modules =
fileSystemInfo=>!fileSystemInfo.Path.FullPath.EndsWith(
                "node_modules",
                StringComparison.OrdinalIgnoreCase);
CleanDirectories("./src/**/bin/debug", exclude_node_modules, new CleanDirectorySettings() { Force = true });

Attributes

Type Description
CakeMethodAliasAttribute An attribute used to mark script method aliases.
CakeAliasCategoryAttribute An attribute used for documentation of alias methods/properties.

Parameters

Name Type Description
context ICakeContext The context.
pattern GlobPattern The pattern to match.
predicate Func<IFileSystemInfo, bool> The predicate used to filter directories based on file system information.
settings CleanDirectorySettings The clean settings.

Return Value

Type Description
void