This content is part of a third party extension that is not supported by the Cake project.
For more information about this extension see Cake.DoInDirectory.
Summary
Changes the current working directory before an
Action
and returns to the previous one in the end
- Assembly
- Cake
.DoInDirectory .dll - Namespace
- Cake
.DoInDirectory - Containing Type
- DoInDirectoryAliases
Syntax
public static void DoInDirectory(this ICakeContext context, DirectoryPath directory, Action task)
Examples
Use the #addin preprocessor directive
#addin nuget:?package=Cake.DoInDirectory
Cake task:
Task("SomeTask").Does(() =>
{
DoInDirectory("./SomeDir", () =>
{
// Do awesome stuff
});
});
Attributes
Type | Description |
---|---|
Cake |
Parameters
Name | Type | Description |
---|---|---|
context | ICakeContext | The context. |
directory | DirectoryPath | The desired working directory for the action. |
task | Action | The action to be executed. |
Return Value
Type | Description |
---|---|
void |