Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent from releasing empty version numbers #33

Closed
wants to merge 1 commit into from
Closed

Prevent from releasing empty version numbers #33

wants to merge 1 commit into from

Conversation

ovax3
Copy link
Contributor

@ovax3 ovax3 commented Jul 22, 2013

When incrementing version number, both semver 1.4.x and 2.0.10 returns a
null value if something went wrong.

As far as I know, the two main cases leading to a null resulting
version are either a bad initial version number, or a bad release type
(e.g. majour).

This patch just makes grunt-release check the resulting version number
(either after a bump or not) for non nullness and throw a grunt warning
if the test fails.

Another solution would have been to add many sanity checks before
starting the release task like checking that the provided release type
has expected value (major, minor, patch, etc) but it appears it is more
flexible to just let the semver library to do the hard work for us and
simply check for non nullness of the resulting version.

When incrementing version number, both semver 1.4.x and 2.0.10 returns a
_null_ value if something went wrong.

As far as I know, the two main cases leading to a _null_ resulting
version are either a bad initial version number, or a bad release type
(e.g. _majour_).

This patch just makes grunt-release check the resulting version number
(either after a bump or not) for non nullness and throw a grunt warning
if the test fails.

Another solution would have been to add many sanity checks before
starting the release task like checking that the provided release type
has expected value (major, minor, patch, etc) but it appears it is more
flexible to just let the _semver_ library to do the hard work for us and
simply check for non nullness of the resulting version.
@geddski
Copy link
Owner

geddski commented Jul 27, 2013

This is a good start. It probably should do a fail.warn if the new version is bad, but only if you're actually needing there to be a new version. Let's come back to this after the tasks are split up better.

@drublic
Copy link
Collaborator

drublic commented Dec 3, 2014

Great commit message! It just landed in 2ab471e. Thanks and cheers.

@drublic drublic closed this Dec 3, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants