From e480353a3deefc9919d3b7e95e52d7756accbf04 Mon Sep 17 00:00:00 2001 From: Shivam Mathur Date: Thu, 13 Jan 2022 04:29:05 +0530 Subject: [PATCH] Process extensions before tools --- __tests__/install.test.ts | 4 ++-- dist/index.js | 2 +- src/install.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/__tests__/install.test.ts b/__tests__/install.test.ts index 23ffdb6e..7f836133 100644 --- a/__tests__/install.test.ts +++ b/__tests__/install.test.ts @@ -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} diff --git a/dist/index.js b/dist/index.js index 013aa552..21ff2e17 100644 --- a/dist/index.js +++ b/dist/index.js @@ -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); } diff --git a/src/install.ts b/src/install.ts index cba0494a..a3c9feae 100644 --- a/src/install.ts +++ b/src/install.ts @@ -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); }