Skip to content

Commit

Permalink
node: match the updated SHASUMS file
Browse files Browse the repository at this point in the history
Part of #365
  • Loading branch information
espadrine committed Feb 8, 2015
1 parent 321c725 commit 3fdf355
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions server.js
Expand Up @@ -937,8 +937,11 @@ cache(function(data, match, sendBadge, request) {
regularUpdate('http://nodejs.org/dist/latest/SHASUMS.txt',
(24 * 3600 * 1000),
function(shasums) {
var firstLine = shasums.slice(0, shasums.indexOf('\n'));
var version = firstLine.split(' ')[1].split('-')[1];
// tarball index start, tarball index end
var taris = shasums.indexOf('node-v');
var tarie = shasums.indexOf('\n', taris);
var tarball = shasums.slice(taris, tarie);
var version = tarball.split('-')[1];
return version;
}, function(err, version) {
if (err != null) { sendBadge(format, badgeData); return; }
Expand Down

0 comments on commit 3fdf355

Please sign in to comment.