Closed alfredbez closed 5 months ago
Do your different branches depend on different captainhook
versions?
One of the last updates required to re-install the hooks.
What changed:
In order to allow user input for all hooks (ask the user to confirm something) I had to handle the original stdIn
hook input differently. That led to a small change in the actual hook scripts.
Now the stdIn
is collected and passed to the Cap'n via --input
option.
If your branches depend on different versions the actual hook scripts can only be valid for one version.
In order to fix this you could re-install the hooks with vendor/bin/captainhook install -f --only-enabled
You could write a post-checkout
hook that checks if the composer.json
file changed and blindly run the install command again.
Or write a custom action that checks if the Cap'n version changed. You would have to compare the composer.lock
version with the composer.json
version.
Again I think it is related to the incompatible hook script. This should not happen too often ... sorry :/ But even a major version update would still have the same problem, because of the version control independent hook scripts.
I had an issue while switching branches that resulted in this message:
I fixed the underlying issue by running
composer install
and wanted to rerun the hooks, so I copied the suggested command and executed:This lead to this error message:
I changed the command then manually:
And this worked finally 🎉
Nice feature btw ❤️