Add support for tools: none

This commit is contained in:
Shivam Mathur
2021-04-21 17:11:24 +05:30
parent 254ecd5a66
commit 8cfcbb030f
3 changed files with 27 additions and 2 deletions

10
dist/index.js vendored
View File

@ -2452,7 +2452,13 @@ exports.addPackage = addPackage;
* @param os_version
*/
async function addTools(tools_csv, php_version, os_version) {
let script = '\n' + (await utils.stepLog('Setup Tools', os_version));
let script = '\n';
if (tools_csv === 'none') {
return '';
}
else {
script += await utils.stepLog('Setup Tools', os_version);
}
const tools_list = await addComposer(await utils.CSVArray(tools_csv));
await utils.asyncForEach(tools_list, async function (release) {
const tool_data = await parseTool(release);
@ -2575,6 +2581,8 @@ async function addTools(tools_csv, php_version, os_version) {
url = github + (await getWpCliUrl(version));
script += await addArchive('wp-cli', url, os_version, '"--version"');
break;
case /^none$/.test(tool):
break;
case /^[\w.-]+\/[\w.-]+$/.test(tool):
script += await addPackage(tool.split('/')[1], release.split('/')[1].replace(/\s+/, ''), tool.split('/')[0] + '/', os_version);
break;