Skip to content

Commit

Permalink
chore(build): make version-info.js run on windows
Browse files Browse the repository at this point in the history
Replaced grep with match
Windows operating systems do not have grep by default

Closes angular#6912.
  • Loading branch information
Bobdina authored and tbosch committed Mar 31, 2014
1 parent 876df04 commit 50eb3b2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/versions/version-info.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ var getGitRepoInfo = function() {
* @return {String} The codename if found, otherwise null/undefined
*/
var getCodeName = function(tagName) {
var tagMessage = shell.exec('git cat-file -p '+ tagName +' | grep "codename"', {silent:true}).output;
var gitCatOutput = shell.exec('git cat-file -p '+ tagName, {silent:true}).output;
var tagMessage = gitCatOutput.match(/^.*codename.*$/mg)[0];
var codeName = tagMessage && tagMessage.match(/codename\((.*)\)/)[1];
if (!codeName) {
throw new Error("Could not extract release code name. The message of tag "+tagName+
Expand Down Expand Up @@ -105,10 +106,10 @@ var getPreviousVersions = function() {
// not contain all commits when cloned with git clone --depth=...
// Needed e.g. for Travis
var repo_url = currentPackage.repository.url;
var tagResults = shell.exec('git ls-remote --tags ' + repo_url + ' | grep -o -e "v[0-9].*[0-9]$"',
var tagResults = shell.exec('git ls-remote --tags ' + repo_url,
{silent: true});
if ( tagResults.code === 0 ) {
return _(tagResults.output.trim().split('\n'))
return _(tagResults.output.match(/v[0-9].*[0-9]$/mg))
.map(function(tag) {
var version = semver.parse(tag);
return version;
Expand Down

0 comments on commit 50eb3b2

Please sign in to comment.