SecurityAliases.

CalculateDirectoryHash(ICakeContext, IEnumerable<GlobPattern>, DirectoryPath) Method

Summary

Calculates the hash for a given directory using the default (SHA256) algorithm.
Namespace
Cake.Common.Security
Containing Type
SecurityAliases

Syntax

[CakeMethodAlias]
public static DirectoryHash CalculateDirectoryHash(this ICakeContext context, IEnumerable<GlobPattern> globs, DirectoryPath directoryPath)

Examples

Information(
    "Cake It calculates the hashes from all cs files in all subdirectories using a SHA256 hash: {0}",
    CalculateDirectoryHash("C:\directoryToHash", "./**/*.cs").ToHex());

Attributes

Type Description
CakeMethodAliasAttribute An attribute used to mark script method aliases.

Parameters

Name Type Description
context ICakeContext The context.
globs IEnumerable<GlobPattern> The glob pattern to match.
directoryPath DirectoryPath The file path.

Return Value

Type Description
DirectoryHash A DirectoryHash instance representing the calculated hash.