mirror of
https://github.com/icewind1991/nextcloud-version-matrix.git
synced 2026-06-03 09:34:12 +02:00
support older style php version check
This commit is contained in:
parent
58becf3b4b
commit
ddbeff6b7a
5 changed files with 26 additions and 9 deletions
10
dist/index.js
vendored
10
dist/index.js
vendored
|
|
@ -42544,8 +42544,14 @@ async function getSupportedVersions(branch) {
|
|||
// yes, this is hacky, but it saves having to keep a list updated
|
||||
let res = await client.get(`https://raw.githubusercontent.com/nextcloud/server/${branch}/lib/versioncheck.php`);
|
||||
let versionCheckCode = await res.readBody();
|
||||
let min = parseVersionId(versionCheckCode.match(/PHP_VERSION_ID < (\d+)/)[1]);
|
||||
let max = parseVersionId(versionCheckCode.match(/PHP_VERSION_ID >= (\d+)/)[1]);
|
||||
let min, max;
|
||||
if (versionCheckCode.match(/PHP_VERSION_ID < (\d+)/)) {
|
||||
min = parseVersionId(versionCheckCode.match(/PHP_VERSION_ID < (\d+)/)[1]);
|
||||
max = parseVersionId(versionCheckCode.match(/PHP_VERSION_ID >= (\d+)/)[1]);
|
||||
} else {
|
||||
min = parseFloat(versionCheckCode.match(/PHP_VERSION, '([\d.]+)'\) === -1/)[1]);
|
||||
max = parseFloat(versionCheckCode.match(/PHP_VERSION, '([\d.]+)'\) !== -1/)[1]);
|
||||
}
|
||||
max = parseFloat((max - 0.1).toFixed(1));
|
||||
return {min: min, max: max};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue