Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cake-contrib/cake.doindirectory
:cake: :jigsaw: Cake addin for easily executing code in a different working directory.
https://github.com/cake-contrib/cake.doindirectory
add-in addin augustoproiete cake cake-addin cake-build hacktoberfest workdir working-dir working-directory
Last synced: 2 months ago
JSON representation
:cake: :jigsaw: Cake addin for easily executing code in a different working directory.
- Host: GitHub
- URL: https://github.com/cake-contrib/cake.doindirectory
- Owner: cake-contrib
- License: mit
- Created: 2016-06-24T16:24:28.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2024-03-10T21:26:30.000Z (12 months ago)
- Last Synced: 2024-12-08T12:35:50.238Z (3 months ago)
- Topics: add-in, addin, augustoproiete, cake, cake-addin, cake-build, hacktoberfest, workdir, working-dir, working-directory
- Language: C#
- Homepage: https://cakebuild.net/extensions/cake-doindirectory/
- Size: 54.7 KB
- Stars: 4
- Watchers: 10
- Forks: 9
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: CODEOWNERS
Awesome Lists containing this project
README
| README.md |
|:---|
Cake.DoInDirectory
Addin for the [Cake](https://cakebuild.net) build automation system that enables you easily execute code in a different working directory.
[](https://www.nuget.org/packages/Cake.DoInDirectory/) [](http://stackoverflow.com/questions/tagged/cakebuild)
## Give a Star! :star:
If you like or are using this project please give it a star. Thanks!
## Getting started :rocket:
Simply add `Cake.DoInDirectory` in your build script by using the [`addin`](http://cakebuild.net/docs/writing-builds/preprocessor-directives#add-in-directive) directive:
```csharp
#addin "nuget:?package=Cake.DoInDirectory&version=x.y.z"
```_Make sure the `&version=` attribute references the [latest version of Cake.DoInDirectory](https://www.nuget.org/packages/Cake.DoInDirectory/) compatible with the Cake runner that you are using. Check the [compatibility table](#compatibility) 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.
```csharp
#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](https://cakebuild.net/docs/running-builds/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](https://github.com/cake-build/cake/discussions), under the [Extension Q&A](https://github.com/cake-build/cake/discussions/categories/extension-q-a) category.
[](https://github.com/cake-build/cake/discussions)
## Release History
Click on the [Releases](https://github.com/cake-contrib/Cake.DoInDirectory/releases) tab on GitHub.
---
_Copyright © 2016-2021 Cake Contributors - Provided under the [MIT License](LICENSE)._