Last active
November 4, 2020 17:51
-
-
Save Barros9/2294fb215650c1dbe365c32143c9d74b to your computer and use it in GitHub Desktop.
GitHookKtLintTask
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
task installGitHook(type: Copy) { | |
def lintingConfigScript = new File(rootProject.rootDir, '.git/hooks/pre-commit') | |
if (!lintingConfigScript.exists()) { | |
from new File(rootProject.rootDir, '.githooks/pre-commit') | |
into { new File(rootProject.rootDir, '.git/hooks') } | |
fileMode 0777 | |
} | |
} | |
tasks.getByPath('app:preBuild').dependsOn installGitHook |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Create git/hooks/pre-commit (without extensions) and add the following script