Use GitHub releases for phive's latest version

This commit is contained in:
Shivam Mathur
2021-12-13 07:47:57 +05:30
parent 1b4cc0b6fa
commit 15b20027cf
4 changed files with 23 additions and 27 deletions

22
dist/index.js vendored
View File

@ -724,26 +724,24 @@ async function addPhive(data) {
case /5\.[3-5]/.test(data['php_version']):
return await utils.addLog('$cross', 'phive', 'Phive is not supported on PHP ' + data['php_version'], data['os_version']);
case /5\.6|7\.0/.test(data['php_version']):
data['version'] = data['version'].replace('latest', '0.12.1');
data['version'] = '0.12.1';
break;
case /7\.1/.test(data['php_version']):
data['version'] = data['version'].replace('latest', '0.13.5');
data['version'] = '0.13.5';
break;
case /7\.2/.test(data['php_version']):
data['version'] = data['version'].replace('latest', '0.14.5');
data['version'] = '0.14.5';
break;
}
if (data['version'] === 'latest') {
data['domain'] = data['domain'] + '/releases';
}
else {
data['domain'] = [
data['github'],
data['repository'],
'releases/download',
data['version']
].join('/');
data['version'] = await getLatestVersion(data);
}
data['domain'] = [
data['github'],
data['repository'],
'releases/download',
data['version']
].join('/');
data['url'] = await getPharUrl(data);
return await addArchive(data);
}