cake-contrib / Cake.DoInDirectory

:cake: :jigsaw: Cake addin for easily executing code in a different working directory.

Home Page:https://cakebuild.net/extensions/cake-doindirectory/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

README.md

Cake.DoInDirectory

Cake.DoInDirectory

Addin for the Cake build automation system that enables you easily execute code in a different working directory.

NuGet Version Stack Overflow Cake Build

Give a Star! ⭐

If you like or are using this project please give it a star. Thanks!

Getting started 🚀

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")
);

Compatibility

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)

Discussion

For questions and to discuss ideas & feature requests, use the GitHub discussions on the Cake GitHub repository, under the Extension Q&A category.

Join in the discussion on the Cake repository

Release History

Click on the Releases tab on GitHub.


Copyright © 2016-2021 Cake Contributors - Provided under the MIT License.

About

:cake: :jigsaw: Cake addin for easily executing code in a different working directory.

https://cakebuild.net/extensions/cake-doindirectory/

License:MIT License


Languages

Language:C# 86.1%Language:PowerShell 6.1%Language:Shell 4.2%Language:Batchfile 3.5%