randomcoder / sbt-git-hooks

SBT Auto Plugin to manage client side git hooks
GNU Affero General Public License v3.0
17 stars 2 forks source link

allow to rename hook dir name #3

Open shivam-880 opened 2 years ago

shivam-880 commented 2 years ago

Allow to rename the default hook directory name from git-hooks to .githooks or make .githooks as default for the sake for convention.

Eli-Golin commented 2 years ago

In theory it should be possible by overriding the hooksSourceDir setting key, but I am afraid it doesn't have any effect. I tried myself overriding the gitHooksDir setting key in order to adopt the plugin to git with sub-modules, but sbt warns me that this key is not used. Very strange.

aartajew commented 1 year ago

You can override default plugin settings in build.sbt file with i.e.:

Seq(GitHooks.globalSettings *)
gitHooksDir := Some(file("../.git/hooks"))

If you want to write hooks on each compile use:

(Compile / compile) := ((Compile / compile) dependsOn writeHooks).value