mirror of
https://github.com/shivammathur/setup-php.git
synced 2025-09-06 21:04:07 +07:00
WP-CLI tool support added
This commit is contained in:

committed by
Shivam Mathur

parent
03fd0b8719
commit
d95ca49e8d
24
dist/index.js
vendored
24
dist/index.js
vendored
@ -1863,6 +1863,26 @@ function getSymfonyUri(version, os_version) {
|
||||
});
|
||||
}
|
||||
exports.getSymfonyUri = getSymfonyUri;
|
||||
/**
|
||||
* Function to get the WP-CLI url
|
||||
*
|
||||
* @param version
|
||||
*/
|
||||
function getWpCliUrl(version) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
switch (version) {
|
||||
case 'latest':
|
||||
return 'https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar';
|
||||
default:
|
||||
return ('https://github.com/wp-cli/wp-cli/releases/download/v' +
|
||||
version +
|
||||
'/wp-cli-' +
|
||||
version +
|
||||
'.phar');
|
||||
}
|
||||
});
|
||||
}
|
||||
exports.getWpCliUrl = getWpCliUrl;
|
||||
/**
|
||||
* Function to add/move composer in the tools list
|
||||
*
|
||||
@ -2048,6 +2068,10 @@ function addTools(tools_csv, php_version, os_version) {
|
||||
url = github + 'symfony/cli/' + uri;
|
||||
script += yield addArchive('symfony', version, url, os_version);
|
||||
break;
|
||||
case 'wp-cli':
|
||||
url = yield getWpCliUrl(version);
|
||||
script += yield addArchive(tool, version, url, os_version);
|
||||
break;
|
||||
default:
|
||||
script += yield utils.addLog('$cross', tool, 'Tool ' + tool + ' is not supported', os_version);
|
||||
break;
|
||||
|
Reference in New Issue
Block a user