kotlinter-gradle icon indicating copy to clipboard operation
kotlinter-gradle copied to clipboard

Skipping hook creation because .git is not a directory

Open bgolob opened this issue 2 years ago • 2 comments

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?

bgolob avatar Sep 15 '22 12:09 bgolob

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.

jeremymailen avatar Oct 03 '22 07:10 jeremymailen

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

klu-tyro avatar Dec 07 '23 06:12 klu-tyro