To help us debug your issue please explain:
I'm using Conan version 1.11.2 on Windows 10. While trying out the new "hooks" feature I had problems installing them using "conan install".
I did the following:
โโโ hooks
โ โโโ my-hook.py
โ
โโโ conan.conf
conan config install myconfigI would expect, that the "my-hook.py" will be copied in to the ".conan/hooks" directory.
Instead, nothing is copied.
I noticed, that it works, if the hook is in a subfolder, i.e. a structure like
โโโ hooks
โ โโโ my-hook
โ |---- my-hook.py
โโโ conan.conf
is copied properly.
Did I miss something? Is it now required to use subfolders in the hooks directory?
Hi @jokoala !
Hooks are considered part of Conan client, so the best option is conan config as described on Hooks documentation:
https://docs.conan.io/en/latest/extending/hooks.html#storage-activation-and-sharing
Regards!
Citing from the page you mentioned.
Hooks are considered part of the Conan client configuration and can be shared as usual with the conan config install command.
This is the reason I experimented with conan config install. I want to roll out a certain hook to all developers on my project.
Sorry, you listed conan install, it's another command.
Now I'm confuse, did you run conan install myconfig or conan config install myconfig ?
Oh, sorry, my mistake. I've updated my request. I ran conan config install as described and it is unable to copy the files, if there is a flat file hierarchy inside the "hooks" folder.
Seems like there is a bug when installing hooks by conan config install. I can reproduce your error:
mkdir -p foo/hooks
touch foo/hooks/dummy.py
conan config install foo
Installing hooks:
Nothing is copied.
Thanks a lot. Its awesome how fast you guys react!
The fix also looks good as far as I can tell.
I tried the new conan version and it seems to behave correctly. Shall I close the issue or is there an automatic process doing that?
You can close it now, thanks for your feedback!
Most helpful comment
Thanks a lot. Its awesome how fast you guys react!
The fix also looks good as far as I can tell.