alexcouper / captainhook

Git hook scripts
BSD 3-Clause "New" or "Revised" License
54 stars 14 forks source link

No such file or directory when installing #77

Closed browniebroke closed 9 years ago

browniebroke commented 9 years ago

Minor issue, I tried to setup captainhook in my project, and had the following error:

> captainhook install
Installing captainhook-0.8.5
Installing pre_commit.py to /path/to/my/project/.git
cp: /path/to/my/project/.git/hooks/pre-commit: No such file or directory
chmod: /path/to/my/project/.git/hooks/pre-commit: No such file or directory
Traceback (most recent call last):
  File "/usr/local/bin/captainhook", line 150, in <module>
    install_checkers(git_location)
  File "/usr/local/bin/captainhook", line 61, in install_checkers
    os.mkdir(dest_checker_folder)
OSError: [Errno 2] No such file or directory: '/path/to/my/project/.git/hooks/checkers'

I applied the following workaround:

mkdir -p .git/hooks/checkers

And then it worked. Easy to workaround, but I think that would be nicer to have captainhook handling the creation itself, sounds reasonable?

alexcouper commented 9 years ago

Thanks for the feeback

Interesting - I think you might have a rather old version of git installed - as the hooks directory comes with git.

Could you tell me which version of git you're using? (git --version)

(I for example have 2.3.2)

browniebroke commented 9 years ago

I think I used to have an old one (1.9.x) when I first cloned the repository I'm working on. On 21 May 2015 19:06, "Alex Couper" notifications@github.com wrote:

Closed #77 https://github.com/alexcouper/captainhook/issues/77.

— Reply to this email directly or view it on GitHub https://github.com/alexcouper/captainhook/issues/77#event-310939835.