Summary
Determines whether the given path refers to an existing directory.
Syntax
[CakeMethodAlias]
[CakeAliasCategory("Exists")]
public static bool DirectoryExists(this ICakeContext context, DirectoryPath path)
Examples
var dir = "publish";
if (!DirectoryExists(dir))
{
CreateDirectory(dir);
}
Attributes
Parameters
Return Value
Type |
Description |
bool |
true if path refers to an existing directory;
false if the directory does not exist or an error occurs when trying to
determine if the specified path exists. |