-
Notifications
You must be signed in to change notification settings - Fork 50
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
Gradlew not found because of outdated path in pre-push hook #269
Comments
Is there any appetite to make this path less brittle? One idea would be to expect |
After thinking about this a bit more, I don't think that's necessary; I think that just replaces one brittle path with another. I think the best way to handle this would be to, in the git hook script, check that the gradlew file exists before trying executing it. If not, print a clear and actionable explanation of what is going wrong and a recommended step to fix it. I would say the first step should be for the user to re-install the git hook (which would fix the hook if you've moved your project to another location) and, if that doesn't work, to open an issue here. That would at least unblock users who cannot push because the hook broke. We could also think about re-running |
Good suggestions. I agree a clear error message would be a good start. |
Another suggestion, why not leave gradlew variable as Here's the broken hook on windows, because i have a space in my folders name:
Here's how it works for me:
I believe the change should be made to this file: https://github.com/jeremymailen/kotlinter-gradle/blob/6ab22c96603f2e1752b2e9d971bf9758f64caa33/src/main/kotlin/org/jmailen/gradle/kotlinter/tasks/GitHookTasks.kt. Would you accept a MR? |
the problem would be for those multimodule projects where gradlew and .git folder are not the same. A more robust solution is needed, I am afraid |
When
git push
ing, with the pre-push hook installed, I got this error:I looked in the pre-push hook code and it has:
The error seems to be because I moved my project to a different directory, so this path is outdated and wrong now.
Hopefully this Google-searchers.
The text was updated successfully, but these errors were encountered: