mirror of
https://github.com/shivammathur/setup-php.git
synced 2024-11-22 03:41:06 +07:00
Fix version prefix for castor
This commit is contained in:
parent
e40aa32c04
commit
c63f07d82e
@ -539,6 +539,7 @@ describe('Tools tests', () => {
|
||||
const data = getData({
|
||||
tool: 'castor',
|
||||
php_version: '8.1',
|
||||
version_prefix: 'v',
|
||||
version: version,
|
||||
os: os
|
||||
});
|
||||
|
22
dist/index.js
vendored
22
dist/index.js
vendored
@ -838,25 +838,9 @@ async function addBlackfirePlayer(data) {
|
||||
}
|
||||
exports.addBlackfirePlayer = addBlackfirePlayer;
|
||||
async function addCastor(data) {
|
||||
let filename;
|
||||
switch (data['os']) {
|
||||
case 'linux':
|
||||
case 'darwin':
|
||||
filename = 'castor.' + data['os'] + '-amd64.phar';
|
||||
break;
|
||||
case 'win32':
|
||||
filename = 'castor.windows-amd64.phar';
|
||||
break;
|
||||
default:
|
||||
return await utils.log('Platform ' + data['os'] + ' is not supported', data['os'], 'error');
|
||||
}
|
||||
if (data['version'] === 'latest') {
|
||||
data['uri'] = ['releases/latest/download', filename].join('/');
|
||||
}
|
||||
else {
|
||||
data['uri'] = ['releases/download', 'v' + data['version'], filename].join('/');
|
||||
}
|
||||
data['url'] = [data['domain'], data['repository'], data['uri']].join('/');
|
||||
data['tool'] = 'castor.' + data['os'].replace('win32', 'windows') + '-amd64';
|
||||
data['url'] = await getUrl(data);
|
||||
data['tool'] = 'castor';
|
||||
return await addArchive(data);
|
||||
}
|
||||
exports.addCastor = addCastor;
|
||||
|
@ -226,7 +226,9 @@
|
||||
"type": "custom-function",
|
||||
"domain": "https://github.com",
|
||||
"repository": "jolicode/castor",
|
||||
"function": "castor"
|
||||
"function": "castor",
|
||||
"version_prefix": "v",
|
||||
"version_parameter": "-V"
|
||||
},
|
||||
"composer": {
|
||||
"type": "custom-function",
|
||||
|
27
src/tools.ts
27
src/tools.ts
@ -236,30 +236,9 @@ export async function addBlackfirePlayer(data: RS): Promise<string> {
|
||||
* @param data
|
||||
*/
|
||||
export async function addCastor(data: RS): Promise<string> {
|
||||
let filename: string;
|
||||
switch (data['os']) {
|
||||
case 'linux':
|
||||
case 'darwin':
|
||||
filename = 'castor.' + data['os'] + '-amd64.phar';
|
||||
break;
|
||||
case 'win32':
|
||||
filename = 'castor.windows-amd64.phar';
|
||||
break;
|
||||
default:
|
||||
return await utils.log(
|
||||
'Platform ' + data['os'] + ' is not supported',
|
||||
data['os'],
|
||||
'error'
|
||||
);
|
||||
}
|
||||
if (data['version'] === 'latest') {
|
||||
data['uri'] = ['releases/latest/download', filename].join('/');
|
||||
} else {
|
||||
data['uri'] = ['releases/download', 'v' + data['version'], filename].join(
|
||||
'/'
|
||||
);
|
||||
}
|
||||
data['url'] = [data['domain'], data['repository'], data['uri']].join('/');
|
||||
data['tool'] = 'castor.' + data['os'].replace('win32', 'windows') + '-amd64';
|
||||
data['url'] = await getUrl(data);
|
||||
data['tool'] = 'castor';
|
||||
return await addArchive(data);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user