aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorBrian Ford2013-08-13 13:17:09 -0700
committerBrian Ford2013-08-15 12:41:14 -0700
commitfe267e30b95e8f48ddc670b97d485f18fb64d39e (patch)
tree2607dc38f11ae473e09dc17caf74aef83ca4e8e7 /lib
parent02d42fda6dd56c8c1cd4af8c9c848fcc5210a370 (diff)
downloadangular.js-fe267e30b95e8f48ddc670b97d485f18fb64d39e.tar.bz2
fix(grunt): fix regex in grunt util to handle pre-release versions
NOTE: this also includes a temporary work-around for Bower
Diffstat (limited to 'lib')
-rw-r--r--lib/grunt/utils.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/grunt/utils.js b/lib/grunt/utils.js
index ff2c6e1d..97e7c416 100644
--- a/lib/grunt/utils.js
+++ b/lib/grunt/utils.js
@@ -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', '');