Neo
Neo

Reputation: 4760

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

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

Upvotes: 0

Views: 458

Answers (1)

Matthias
Matthias

Reputation: 16209

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

Upvotes: 0

Related Questions