Skip to content

Commit 50eb3b2

Browse files
Bobdinatbosch
authored andcommitted
chore(build): make version-info.js run on windows
Replaced grep with match Windows operating systems do not have grep by default Closes angular#6912.
1 parent 876df04 commit 50eb3b2

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/versions/version-info.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ var getGitRepoInfo = function() {
4646
* @return {String} The codename if found, otherwise null/undefined
4747
*/
4848
var getCodeName = function(tagName) {
49-
var tagMessage = shell.exec('git cat-file -p '+ tagName +' | grep "codename"', {silent:true}).output;
49+
var gitCatOutput = shell.exec('git cat-file -p '+ tagName, {silent:true}).output;
50+
var tagMessage = gitCatOutput.match(/^.*codename.*$/mg)[0];
5051
var codeName = tagMessage && tagMessage.match(/codename\((.*)\)/)[1];
5152
if (!codeName) {
5253
throw new Error("Could not extract release code name. The message of tag "+tagName+
@@ -105,10 +106,10 @@ var getPreviousVersions = function() {
105106
// not contain all commits when cloned with git clone --depth=...
106107
// Needed e.g. for Travis
107108
var repo_url = currentPackage.repository.url;
108-
var tagResults = shell.exec('git ls-remote --tags ' + repo_url + ' | grep -o -e "v[0-9].*[0-9]$"',
109+
var tagResults = shell.exec('git ls-remote --tags ' + repo_url,
109110
{silent: true});
110111
if ( tagResults.code === 0 ) {
111-
return _(tagResults.output.trim().split('\n'))
112+
return _(tagResults.output.match(/v[0-9].*[0-9]$/mg))
112113
.map(function(tag) {
113114
var version = semver.parse(tag);
114115
return version;

0 commit comments

Comments
 (0)