nedbat / scriv

Changelog management tool
https://scriv.readthedocs.io
Apache License 2.0
256 stars 28 forks source link

Unhelpful behavior of `scriv collect` when there are no fragments #110

Closed SpecLad closed 11 months ago

SpecLad commented 11 months ago

Currently, if you try to run scriv collect and there are no changelog fragments, this happens:

$ scriv collect
Collecting from changelog.d
No changelog fragments to collect
$ echo $?
0

... and the changelog is unchanged.

I find this behavior unhelpful. I'm using scriv in automation, so I'd like to be able to rely on the property that if scriv collect succeeds, then it has added a new section to the changelog file. Therefore, I'd like to ask that this behavior be changed to one of the following:

  1. Do nothing and return an error status.
  2. Insert an empty section into the changelog and return a success status.

I don't think I have a strong preference for either, but 1 seems like the safer option.

nedbat commented 11 months ago

Good point. Now it exits with a status code of 2 in commit 5bf4cf1985815c8a7caa52a3a8477812fb4b105f.

nedbat commented 11 months ago

This is now released as part of scriv 1.4.0.