Skip to content

Commit

Permalink
chore(version-info): use branchPattern where we are replacing *
Browse files Browse the repository at this point in the history
  • Loading branch information
petebacondarwin committed Jan 14, 2015
1 parent 299b3e7 commit 1a7e9de
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/versions/version-info.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ var getTaggedVersion = function() {
if ( version && semver.satisfies(version, currentPackage.branchVersion)) {
version.codeName = getCodeName(tag);
version.full = version.version;
version.branch = 'v' + currentPackage.branchVersion.replace('*', 'x');
version.branch = 'v' + currentPackage.branchPattern.replace('*', 'x');
return version;
}
}
Expand Down Expand Up @@ -130,13 +130,17 @@ var getCdnVersion = function() {
return semver.satisfies(tag, currentPackage.branchVersion);
})
.reverse()
.tap(function(versions) {
console.log(versions);
})
.reduce(function(cdnVersion, version) {
if (!cdnVersion) {
// Note: need to use shell.exec and curl here
// as version-infos returns its result synchronously...
var cdnResult = shell.exec('curl http://ajax.googleapis.com/ajax/libs/angularjs/'+version+'/angular.min.js '+
'--head --write-out "%{http_code}" -o /dev/null -silent',
{silent: true});
{silent: false});
console.log('http://ajax.googleapis.com/ajax/libs/angularjs/'+version+'/angular.min.js');
if ( cdnResult.code === 0 ) {
var statusCode = cdnResult.output.trim();
if (statusCode === '200') {
Expand All @@ -161,7 +165,7 @@ var getSnapshotVersion = function() {

if ( !version ) {
// a snapshot version before the first tag on the branch
version = semver(currentPackage.branchVersion.replace('*','0-beta.1'));
version = semver(currentPackage.branchPattern.replace('*','0-beta.1'));
}

// We need to clone to ensure that we are not modifying another version
Expand Down

0 comments on commit 1a7e9de

Please sign in to comment.