DirectoryAliases.

Directory(ICakeContext, string) Method

Summary

Gets a directory path from string.
Namespace
Cake.Common.IO
Containing Type
DirectoryAliases

Syntax

[CakeMethodAlias]
[CakeNamespaceImport("Cake.Common.IO.Paths")]
public static ConvertableDirectoryPath Directory(this ICakeContext context, string path)

Examples

 // Get the temp directory.
 var root = Directory("./");
 var temp = root + Directory("temp");

 // Clean the directory.
 CleanDirectory(temp);

Attributes

Type Description
CakeMethodAliasAttribute An attribute used to mark script method aliases.
CakeNamespaceImportAttribute An attribute used to hint Cake about additional namespaces that need to be imported for an alias to work. This attribute can mark an extension method, the extension method class, or the assembly to provide a global set of imports

Parameters

Name Type Description
context ICakeContext The context.
path string The path.

Return Value

Type Description
ConvertableDirectoryPath A directory path.