diff options
| author | Brian Ford | 2013-08-13 13:17:09 -0700 | 
|---|---|---|
| committer | Brian Ford | 2013-08-15 12:43:05 -0700 | 
| commit | 553fdb318f53cc2e769cca9cb0e3c634102a0cb1 (patch) | |
| tree | fa6dfeebe457d148fc219e438fa328dd23f87160 | |
| parent | 607ed4ee468966984635a5816719cc430e2757c5 (diff) | |
| download | angular.js-553fdb318f53cc2e769cca9cb0e3c634102a0cb1.tar.bz2 | |
fix(grunt): fix regex in grunt util to handle pre-release versions
NOTE: this also includes a temporary work-around for Bower
| -rw-r--r-- | lib/grunt/utils.js | 4 | 
1 files changed, 3 insertions, 1 deletions
| diff --git a/lib/grunt/utils.js b/lib/grunt/utils.js index 7e85b400..049f4980 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', ''); | 
