last-release-apm
Advanced tools
Comparing version 1.1.1 to 1.1.2
@@ -26,4 +26,10 @@ 'use strict'; | ||
var GITHUB_API = 'https://api.github.com'; | ||
var GITHUB_API = 'https://api.github.com'; /** | ||
* Dependencies | ||
*/ | ||
var headers = { | ||
'User-Agent': 'LastReleaseApm/' + require('../package.json').version | ||
}; | ||
/** | ||
@@ -33,10 +39,7 @@ * Interface | ||
/** | ||
* Dependencies | ||
*/ | ||
function getHead(pack, version, callback) { | ||
var requestSettings = { | ||
url: GITHUB_API + '/repos/' + (0, _package2.default)(pack) + '/tags', | ||
json: true | ||
json: true, | ||
headers: headers | ||
}; | ||
@@ -50,7 +53,8 @@ | ||
if (response.statusCode === 200) { | ||
tags.forEach(function (tag) { | ||
if (tag.name === 'v' + version) { | ||
return callback(null, tag.commit.sha); | ||
} | ||
var match = tags.filter(function (tag) { | ||
return tag.name === 'v' + version; | ||
}); | ||
if (match.length) { | ||
return callback(null, match[0].commit.sha); | ||
} | ||
} | ||
@@ -57,0 +61,0 @@ |
@@ -27,2 +27,5 @@ 'use strict'; | ||
var ATOM_REGISTRY = 'https://atom.io'; | ||
var headers = { | ||
'User-Agent': 'LastReleaseApm/' + require('../package.json').version | ||
}; | ||
@@ -33,6 +36,7 @@ /** | ||
function atomVersion(pkg, callback) { | ||
function atomVersion(pack, callback) { | ||
var requestSettings = { | ||
url: ATOM_REGISTRY + '/api/packages/' + pkg.name, | ||
json: true | ||
url: ATOM_REGISTRY + '/api/packages/' + pack.name, | ||
json: true, | ||
headers: headers | ||
}; | ||
@@ -39,0 +43,0 @@ |
{ | ||
"name": "last-release-apm", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "determine the version of the last release via the apm registry", | ||
@@ -5,0 +5,0 @@ "author": "Arnaud Dezandee <dezandee.arnaud@gmail.com> (https://github.com/Adezandee)", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15625
149