From be3ee051781a91d7375c56b06a0e9288633f1c3b Mon Sep 17 00:00:00 2001 From: Shivam Mathur Date: Fri, 3 Jul 2020 15:06:42 +0530 Subject: [PATCH] Use shivammathur/extensions tap for grpc, swoole, protobuf on macos --- __tests__/extensions.test.ts | 5 ++++- dist/index.js | 12 ++++++------ src/extensions.ts | 12 ++++++------ 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/__tests__/extensions.test.ts b/__tests__/extensions.test.ts index 941ec7d1..f9a1929b 100644 --- a/__tests__/extensions.test.ts +++ b/__tests__/extensions.test.ts @@ -85,12 +85,15 @@ describe('Extension tests', () => { it('checking addExtensionOnDarwin', async () => { let darwin: string = await extensions.addExtension( - 'Xdebug, pcov, sqlite, ast-beta', + 'Xdebug, pcov, grpc, protobuf, swoole, sqlite, ast-beta', '7.2', 'darwin' ); expect(darwin).toContain('add_brew_extension xdebug'); expect(darwin).toContain('add_brew_extension pcov'); + expect(darwin).toContain('add_brew_extension grpc'); + expect(darwin).toContain('add_brew_extension protobuf'); + expect(darwin).toContain('add_brew_extension swoole'); expect(darwin).toContain('sudo pecl install -f sqlite3'); expect(darwin).toContain('add_unstable_extension ast beta extension'); diff --git a/dist/index.js b/dist/index.js index 9b66d196..b1f4bd0c 100644 --- a/dist/index.js +++ b/dist/index.js @@ -2696,13 +2696,13 @@ async function addExtensionDarwin(extension_csv, version, pipe) { ' ' + ext_prefix; return; - // match 5.6xdebug, 7.0xdebug...7.4xdebug, 8.0xdebug - case /(5\.6|7\.[0-4]|8\.[0-9])xdebug/.test(version_extension): - command = 'add_brew_extension xdebug'; - break; - // match 7.1pcov...7.4pcov, 8.0pcov + // match 5.6xdebug to 8.0xdebug, 5.6swoole to 8.0swoole + // match 5.6grpc to 7.4grpc, 5.6protobuf to 7.4protobuf + // match 7.1pcov to 8.0pcov + case /(5\.6|7\.[0-4]|8\.[0-9])(xdebug|swoole)/.test(version_extension): + case /(5\.6|7\.[0-4])(grpc|protobuf)/.test(version_extension): case /(7\.[1-4]|8\.[0-9])pcov/.test(version_extension): - command = 'add_brew_extension pcov'; + command = 'add_brew_extension ' + extension_name; break; // match 5.6redis case /5\.6redis/.test(version_extension): diff --git a/src/extensions.ts b/src/extensions.ts index a2da177f..66874854 100644 --- a/src/extensions.ts +++ b/src/extensions.ts @@ -50,13 +50,13 @@ export async function addExtensionDarwin( ' ' + ext_prefix; return; - // match 5.6xdebug, 7.0xdebug...7.4xdebug, 8.0xdebug - case /(5\.6|7\.[0-4]|8\.[0-9])xdebug/.test(version_extension): - command = 'add_brew_extension xdebug'; - break; - // match 7.1pcov...7.4pcov, 8.0pcov + // match 5.6xdebug to 8.0xdebug, 5.6swoole to 8.0swoole + // match 5.6grpc to 7.4grpc, 5.6protobuf to 7.4protobuf + // match 7.1pcov to 8.0pcov + case /(5\.6|7\.[0-4]|8\.[0-9])(xdebug|swoole)/.test(version_extension): + case /(5\.6|7\.[0-4])(grpc|protobuf)/.test(version_extension): case /(7\.[1-4]|8\.[0-9])pcov/.test(version_extension): - command = 'add_brew_extension pcov'; + command = 'add_brew_extension ' + extension_name; break; // match 5.6redis case /5\.6redis/.test(version_extension):