Cake.GitHooks
1.1.1
dotnet add package Cake.GitHooks --version 1.1.1
NuGet\Install-Package Cake.GitHooks -Version 1.1.1
<PackageReference Include="Cake.GitHooks" Version="1.1.1" />
<PackageVersion Include="Cake.GitHooks" Version="1.1.1" />
<PackageReference Include="Cake.GitHooks" />
paket add Cake.GitHooks --version 1.1.1
#r "nuget: Cake.GitHooks, 1.1.1"
#:package Cake.GitHooks@1.1.1
#addin nuget:?package=Cake.GitHooks&version=1.1.1
#tool nuget:?package=Cake.GitHooks&version=1.1.1
Cake.GitHooks
Overview
Cake.GitHooks is a cake addin that provides functionality to manage your git hooks in your cake scripts. It provides a simple API to check availability of your git hooks and to deploy them in a single step. This extension aims to simplify distributing and updating git hooks across the contributors of your project.
Usage
Git hooks are sourced from a folder in your project. The addin installs the hooks to your local git repository.
DeployGitHooks
Deploys hooks to the local .git/hooks directory. (Also checks if deployed git hooks are on the latest version)
DeployGitHooks();
Configuration
To configure the source and destination path of your hooks, you can build GitHooksSettings for each method.
DeployGitHooks(settings =>
{
settings.SourcePath = "./custom-hooks/";
settings.DestinationPath = "./.git/hooks/";
});
The default setting of the git hooks source directory is ./hooks. The git hooks are deployed to the destination directory ./.git/hooks.
Example build script
Task("Setup-GitHooks")
.Does(() =>
{
DeployGitHooks();
});
RunTarget("Setup-GitHooks");
Getting started
The package is published to the GitHub Packages NuGet registry. To use the package in your Cake build script project, you must add the GitHub Packages NuGet registry to your Cake build script project's NuGet.config file. For more information, see the following link:
Add the Cake.GitHooks NuGet package to your Cake build script project.
#addin nuget:?package=Cake.GitHooks
Import the namespace in your Cake build script.
using Cake.GitHooks;
Use the provided aliases in your Cake build script as needed.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net9.0
- Cake.Common (>= 5.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.