-1

I am trying to use detekt on my android project but when i try to commit using sourcetree i get this error.

Checking prerequisites Collecting modified files Running detekt .git/hooks/pre-commit: line 33: detekt: command not found

print of the error on sourcetree

  • **DO NOT post images of code, data, error messages, etc.** - copy or type the text into the question. Please reserve the use of images for diagrams or demonstrating rendering bugs, things that are impossible to describe accurately via text. For more information please see the Meta FAQ entry [Why not upload images of code/errors when asking a question?](https://meta.stackoverflow.com/questions/285551/why-not-upload-images-of-code-errors-when-asking-a-question/285557#285557). – nobleknight Jun 11 '21 at 12:36

1 Answers1

0

I suspect you have detekt installed in a location that is not in your $PATH (e.g. not in /usr/local/bin or /usr/bin or similar).

Try finding where detekt is installed with which detekt (or possibly other searching) and once you find where it is, put the full path to it in when calling it in the pre-commit hook.

Mort
  • 3,379
  • 1
  • 25
  • 40