mirror of
https://github.com/shivammathur/setup-php.git
synced 2025-08-31 01:44:08 +07:00
Add support for jolicode/castor
This commit is contained in:
34
src/tools.ts
34
src/tools.ts
@ -230,6 +230,39 @@ export async function addBlackfirePlayer(data: RS): Promise<string> {
|
||||
return addArchive(data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to add Castor
|
||||
*
|
||||
* @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('/');
|
||||
return await addArchive(data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to add composer
|
||||
*
|
||||
@ -479,6 +512,7 @@ export async function getData(
|
||||
}
|
||||
|
||||
export const functionRecord: Record<string, (data: RS) => Promise<string>> = {
|
||||
castor: addCastor,
|
||||
composer: addComposer,
|
||||
deployer: addDeployer,
|
||||
dev_tools: addDevTools,
|
||||
|
Reference in New Issue
Block a user