Process extensions before tools

This commit is contained in:
Shivam Mathur 2022-01-13 04:29:05 +05:30
parent 3a4acaaed8
commit e480353a3d
No known key found for this signature in database
GPG Key ID: 3E13E4C8591ACC2A
3 changed files with 4 additions and 4 deletions

View File

@ -11,8 +11,8 @@ jest.mock('../src/install', () => ({
const coverage_driver: string = process.env['coverage'] || '';
const tools_csv: string = process.env['tools'] || '';
let script = 'initial script';
script += tools_csv ? ' add_tool' : '';
script += extension_csv ? ' install extensions' : '';
script += tools_csv ? ' add_tool' : '';
script += coverage_driver ? ' set coverage driver' : '';
script += ini_values_csv ? ' edit php.ini' : '';
return script;
@ -70,7 +70,7 @@ describe('Install', () => {
${'8.0'} | ${'darwin'} | ${''} | ${''} | ${''} | ${''} | ${'initial script bash darwin.sh 8.0 ' + __dirname}
${'8.1'} | ${'darwin'} | ${''} | ${''} | ${''} | ${''} | ${'initial script bash darwin.sh 8.1 ' + __dirname}
${'7.3'} | ${'linux'} | ${''} | ${''} | ${''} | ${''} | ${'initial script bash linux.sh 7.3 ' + __dirname}
${'7.3'} | ${'linux'} | ${'a, b'} | ${'a=b'} | ${'x'} | ${'phpunit'} | ${'initial script add_tool install extensions set coverage driver edit php.ini bash linux.sh 7.3 ' + __dirname}
${'7.3'} | ${'linux'} | ${'a, b'} | ${'a=b'} | ${'x'} | ${'phpunit'} | ${'initial script install extensions add_tool set coverage driver edit php.ini bash linux.sh 7.3 ' + __dirname}
${'latest'} | ${'linux'} | ${''} | ${''} | ${''} | ${''} | ${'initial script bash linux.sh 8.1 ' + __dirname}
${'7.0'} | ${'win32'} | ${''} | ${''} | ${''} | ${''} | ${'initial script pwsh win32.ps1 7.0 ' + __dirname}
${'7.3'} | ${'win32'} | ${''} | ${''} | ${''} | ${''} | ${'initial script pwsh win32.ps1 7.3 ' + __dirname}

2
dist/index.js vendored
View File

@ -450,10 +450,10 @@ async function getScript(filename, version, os_version) {
const coverage_driver = await utils.getInput('coverage', false);
const tools_csv = await utils.getInput('tools', false);
let script = await utils.readFile(filename, 'src/scripts');
script += await tools.addTools(tools_csv, version, os_version);
if (extension_csv) {
script += await extensions.addExtension(extension_csv, version, os_version);
}
script += await tools.addTools(tools_csv, version, os_version);
if (coverage_driver) {
script += await coverage.addCoverage(coverage_driver, version, os_version);
}

View File

@ -27,10 +27,10 @@ export async function getScript(
const tools_csv: string = await utils.getInput('tools', false);
let script: string = await utils.readFile(filename, 'src/scripts');
script += await tools.addTools(tools_csv, version, os_version);
if (extension_csv) {
script += await extensions.addExtension(extension_csv, version, os_version);
}
script += await tools.addTools(tools_csv, version, os_version);
if (coverage_driver) {
script += await coverage.addCoverage(coverage_driver, version, os_version);
}