Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skipping hook creation because .git is not a directory #282

Open
bgolob opened this issue Sep 15, 2022 · 2 comments
Open

Skipping hook creation because .git is not a directory #282

bgolob opened this issue Sep 15, 2022 · 2 comments

Comments

@bgolob
Copy link

bgolob commented Sep 15, 2022

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?

@jeremymailen
Copy link
Owner

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.

@klu-tyro
Copy link

klu-tyro commented Dec 7, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants