kotlinter-gradle
kotlinter-gradle copied to clipboard
Skipping hook creation because .git is not a directory
Hello, I'm trying to install the git hook using installKotlinterPrePushHook. The problem I have is that .git folder is located in a different directory than gradlew. Because of that when executing ./gradlew installKotlinterPrePushHook I'm getting this message Task :installKotlinterPrePushHook skipping hook creation because /home/user/testproject/.git is not a directory. Is there any way to resolve this issue?
Noted. The current resolution would be to manually edit the GRADLEW
path in the hook script. We don't do a sophisticated job of locating the gradle exe today.
I'm having the same problem when installing the hook by running the gradle task installKotlinterPrePushHook
.
My problem was because my gradlew file is under a subfolder named app
but the .git
folder is located in the root folder.
Thought this might be helpful for fixing the issue: https://github.com/JLLeitschuh/ktlint-gradle/blob/7901898515664f9aad1fb3684dd6e87ff9467cd5/plugin/src/main/kotlin/org/jlleitschuh/gradle/ktlint/GitHook.kt#L164