Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit fe267e3

Browse files
committed
fix(grunt): fix regex in grunt util to handle pre-release versions
NOTE: this also includes a temporary work-around for Bower
1 parent 02d42fd commit fe267e3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/grunt/utils.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ module.exports = {
1717
if (version) return version;
1818

1919
var package = JSON.parse(fs.readFileSync('package.json', 'UTF-8'));
20-
var match = package.version.match(/^([^\-]*)(-snapshot)?$/);
20+
// TODO(brian): change `(-|rc)` to `-` in the regex below after bower
21+
// fixes this issue: https://github.com/bower/bower/issues/782
22+
var match = package.version.match(/^([^\-]*)(?:(-|rc)(.+))?$/);
2123
var semver = match[1].split('.');
2224
var hash = shell.exec('git rev-parse --short HEAD', {silent: true}).output.replace('\n', '');
2325

0 commit comments

Comments
 (0)