Skip to content

Commit

Permalink
Work around invalid version numbers in the r-builds version list
Browse files Browse the repository at this point in the history
  • Loading branch information
gaborcsardi committed Feb 29, 2024
1 parent 8ead9bb commit 6a3ba63
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@

# 2.3.7

* Work around invalid version numbers in the r-builds version list.

# 2.3.6

* Add support for retired distros for which we have binaries.
Expand Down
6 changes: 5 additions & 1 deletion lib/linux-builds-amd64.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@

const semver = require('semver');
const mycache = require('./cache');
const urls = require('./urls');

Expand All @@ -10,7 +11,10 @@ async function linux_builds_amd64(cache = true) {
if (cached !== undefined) { return cached; }

var resp = await got(urls.linux_builds_amd64).json();
const value = resp.r_versions;
var value = resp.r_versions;
value = value.filter(function(x) {
return !!semver.valid(x) || x == 'next' || x == 'devel'
});

mycache.set('linux_builds_amd64', value);
return value;
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rversions",
"version": "2.3.6",
"version": "2.3.7",
"description": "Query the current and past R versions",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 6a3ba63

Please sign in to comment.