Dotnetcore Project to have version controlled pre-commit / pre-push hooks

409 Views Asked by At

I am coming from NodeJS world where I can easily add pre-commit and pre-push hooks with the husky or many other libraries.

Is there any way/library that can do the same for dotnetcore?

If not can Nukebuild copy files to ../.git/hooks folder (based on the OS)? I am looking for something like

public Targets Hook => _ => _
            .Description("Setup Hooks")
            .Executes(() => {
               // checks the os
               // copy file to ../.git/hooks based on the os
            });

1

There are 1 best solutions below

0
On

You can check on which operating system you're on using EnvironmentInfo.IsWin, IsUnix, IsOsx.