mirror of
https://github.com/shivammathur/setup-php.git
synced 2024-11-22 11:51:07 +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({
|
const data = getData({
|
||||||
tool: 'castor',
|
tool: 'castor',
|
||||||
php_version: '8.1',
|
php_version: '8.1',
|
||||||
|
version_prefix: 'v',
|
||||||
version: version,
|
version: version,
|
||||||
os: os
|
os: os
|
||||||
});
|
});
|
||||||
|
22
dist/index.js
vendored
22
dist/index.js
vendored
@ -838,25 +838,9 @@ async function addBlackfirePlayer(data) {
|
|||||||
}
|
}
|
||||||
exports.addBlackfirePlayer = addBlackfirePlayer;
|
exports.addBlackfirePlayer = addBlackfirePlayer;
|
||||||
async function addCastor(data) {
|
async function addCastor(data) {
|
||||||
let filename;
|
data['tool'] = 'castor.' + data['os'].replace('win32', 'windows') + '-amd64';
|
||||||
switch (data['os']) {
|
data['url'] = await getUrl(data);
|
||||||
case 'linux':
|
data['tool'] = 'castor';
|
||||||
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('/');
|
|
||||||
return await addArchive(data);
|
return await addArchive(data);
|
||||||
}
|
}
|
||||||
exports.addCastor = addCastor;
|
exports.addCastor = addCastor;
|
||||||
|
@ -226,7 +226,9 @@
|
|||||||
"type": "custom-function",
|
"type": "custom-function",
|
||||||
"domain": "https://github.com",
|
"domain": "https://github.com",
|
||||||
"repository": "jolicode/castor",
|
"repository": "jolicode/castor",
|
||||||
"function": "castor"
|
"function": "castor",
|
||||||
|
"version_prefix": "v",
|
||||||
|
"version_parameter": "-V"
|
||||||
},
|
},
|
||||||
"composer": {
|
"composer": {
|
||||||
"type": "custom-function",
|
"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
|
* @param data
|
||||||
*/
|
*/
|
||||||
export async function addCastor(data: RS): Promise<string> {
|
export async function addCastor(data: RS): Promise<string> {
|
||||||
let filename: string;
|
data['tool'] = 'castor.' + data['os'].replace('win32', 'windows') + '-amd64';
|
||||||
switch (data['os']) {
|
data['url'] = await getUrl(data);
|
||||||
case 'linux':
|
data['tool'] = 'castor';
|
||||||
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('/');
|
|
||||||
return await addArchive(data);
|
return await addArchive(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user