Closed rwjblue closed 8 years ago
It seems to me like we're just missing a hook that runs after the tag is calculated but before anything filesystem changes. I'm in favor of creating a new hook whose name is descriptive of when in the workflow it runs; preventRelease
implies to me that it is executed before pushing things, not before anything really happens.
Throwing from a hook already aborts the release and prints the error message (although maybe it could be wrapped in SilentError
for better formatting). If the name doesn't imply that its sole purpose is for aborting, throwing an error is a natural way to prevent anything else from happening.
What about beforeReplace
? I'm also having trouble coming up with a decent name.
There have been a number of times that I have wanted a hook in
config/release.js
that is called with the same arguments asbeforeCommit
andafterPush
which allows me to prevent any modifications. This would be done just after step 3.A few scenarios where this would be helpful:
master
is up to date with remotemaster
. If this is not true, thegit push origin master
step fails, but only after already commiting and tagging locally. We should probably detect this scenario all the time (and not rely on a new hook), but it is a good example of why a hook would be useful.afterPush
process. Assume that you need to run a series of commands inafterPush
, and you want to avoid commiting/tagging/pushing if the local system isn't properly setup. ExampleMy thought was that if we added a
preventRelease
hook you could returntrue
to prevent modifications. Something like:I am not very tied to the name
preventRelease
(open to better suggestions).