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

Commit

Permalink
fix(grunt): fix regex in grunt util to handle pre-release versions
Browse files Browse the repository at this point in the history
NOTE: this also includes a temporary work-around for Bower
  • Loading branch information
btford committed Aug 15, 2013
1 parent 02d42fd commit fe267e3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/grunt/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ module.exports = {
if (version) return version;

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

Expand Down

0 comments on commit fe267e3

Please sign in to comment.