Skip to content

Commit 1248e5a

Browse files
classix-asmportuga
authored andcommitted
fix(build): Cope with tags not conforming to semver format when building. (#6376)
If a developer had defined a git tag which did not conform to the semver format "vx.y.z", the build process would take this tag and assume it to be the current version but fail when it does not. The script now skips these tags. It might also make sense to warn about these tags, as the developer may have had a typo. But this still enforces the pattern to only have tags in that format. Before this fix, if such a tag had been defined the following error message appeared: $ grunt Loading "Gruntfile.js" tasks...ERROR >> TypeError: Cannot read property 'match' of null
1 parent 5ccd7f3 commit 1248e5a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: lib/grunt/utils.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ var util = module.exports = {
360360

361361
var v = semver.clean(tag);
362362

363-
if (!v.match(/-.+?$/)) {
363+
if (v && !v.match(/-.+?$/)) {
364364
return v;
365365
}
366366
}

0 commit comments

Comments
 (0)