README.md |
---|
Addin for the Cake build automation system that enables you easily execute code in a different working directory.
If you like or are using this project please give it a star. Thanks!
Simply add Cake.DoInDirectory
in your build script by using the addin
directive:
#addin "nuget:?package=Cake.DoInDirectory&version=x.y.z"
Make sure the &version=
attribute references the latest version of Cake.DoInDirectory compatible with the Cake runner that you are using. Check the compatibility table to see which version of Cake.DoInDirectory to choose.
The DoInDirectory
method temporarily switches to a new working directory, executes the code block you want in that directory, and switches back to the original working directory at the end.
#addin "nuget:?package=Cake.DoInDirectory&version=x.y.z"
DoInDirectory("Some/Sub/Directory", () =>
Npm.RunScript("test")
);
Cake.DoInDirectory is compatible with all Cake runners, and below you can find which version of Cake.DoInDirectory you should use based on the version of the Cake runner you're using.
Cake runner | Cake.DoInDirectory | Cake addin directive |
---|---|---|
1.0.0 or higher | 4.0.0 or higher | #addin "nuget:?package=Cake.DoInDirectory&version=4.0.2" |
0.33.0 - 0.38.5 | 3.3.0 | #addin "nuget:?package=Cake.DoInDirectory&version=3.3.0" |
< 0.33.0 | N/A | (not supported) |
For questions and to discuss ideas & feature requests, use the GitHub discussions on the Cake GitHub repository, under the Extension Q&A category.
Click on the Releases tab on GitHub.
Copyright © 2016-2021 Cake Contributors - Provided under the MIT License.