Skip to content

Commit

Permalink
Fix copying of the pre-commit Git hook
Browse files Browse the repository at this point in the history
  • Loading branch information
MGaetan89 committed Aug 30, 2024
1 parent 9eddb12 commit 6f3ae2e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,14 @@ val clean by tasks.registering(Delete::class) {
*/
val installGitHook by tasks.registering(Copy::class) {
description = "Adding Git hook script to local working copy"
from(file("${rootProject.rootDir}/git_hooks/pre-commit"))
into { file("${rootProject.rootDir}/.git/hooks") }
from(rootProject.file("git_hooks/pre-commit"))
into(rootProject.file(".git/hooks"))
filePermissions {
unix("rwxr-xr-x")
}
doFirst {
delete(rootProject.file(".git/hooks/pre-commit"))
}
}

tasks.getByPath(":data:preBuild").dependsOn(":installGitHook")

0 comments on commit 6f3ae2e

Please sign in to comment.