From 1229133602685762479de79c9a70c204c4395b0f Mon Sep 17 00:00:00 2001 From: Shivam Mathur Date: Thu, 9 Sep 2021 02:40:49 +0530 Subject: [PATCH] Use shivammathur/extensions tap to install vips on macOS --- __tests__/extensions.test.ts | 3 ++- dist/index.js | 1 + src/extensions.ts | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/__tests__/extensions.test.ts b/__tests__/extensions.test.ts index ce533401..f10a294c 100644 --- a/__tests__/extensions.test.ts +++ b/__tests__/extensions.test.ts @@ -73,7 +73,7 @@ describe('Extension tests', () => { it('checking addExtensionOnDarwin', async () => { let darwin: string = await extensions.addExtension( - 'Xdebug, pcov, grpc, igbinary, imagick, phalcon3, phalcon4, protobuf, psr, rdkafka, swoole, sqlite, ast-beta', + 'Xdebug, pcov, grpc, igbinary, imagick, phalcon3, phalcon4, protobuf, psr, rdkafka, swoole, vips, sqlite, ast-beta', '7.2', 'darwin' ); @@ -88,6 +88,7 @@ describe('Extension tests', () => { expect(darwin).toContain('add_brew_extension psr'); expect(darwin).toContain('add_brew_extension rdkafka'); expect(darwin).toContain('add_brew_extension swoole'); + expect(darwin).toContain('add_brew_extension vips'); expect(darwin).toContain('pecl_install sqlite3'); expect(darwin).toContain('add_unstable_extension ast beta extension'); diff --git a/dist/index.js b/dist/index.js index 0ba93f02..d0a9ab28 100644 --- a/dist/index.js +++ b/dist/index.js @@ -233,6 +233,7 @@ async function addExtensionDarwin(extension_csv, version) { case /(5\.6|7\.[0-4]|8.0)(amqp|grpc|igbinary|imagick|imap|mongodb|msgpack|^(pecl_)?http$|propro|protobuf|psr|raphf|rdkafka|redis|swoole|xdebug|xdebug2|yaml|zmq)/.test(version_extension): case /(7\.[1-4]|8\.0])pcov/.test(version_extension): case /^(5\.6|7\.[0-3])phalcon3$|^7\.[2-4]phalcon4$/.test(version_extension): + case /(7\.[0-4]|8\.0])vips/.test(version_extension): command = 'add_brew_extension ' + extension_name.replace('pecl_', ''); break; case /^sqlite$/.test(extension): diff --git a/src/extensions.ts b/src/extensions.ts index d0b08cd2..eccf753f 100644 --- a/src/extensions.ts +++ b/src/extensions.ts @@ -32,6 +32,7 @@ export async function addExtensionDarwin( return; // match 5.6 to 8.0 amqp, grpc, igbinary, imagick, imap, mongodb, msgpack, pecl_http, propro, protobuf, raphf, rdkafka, redis, swoole, xdebug, xdebug2, yaml, zmq // match 7.1pcov to 8.0pcov + // match 7.0vips to 8.0vips case /(5\.6|7\.[0-4]|8.0)(amqp|grpc|igbinary|imagick|imap|mongodb|msgpack|^(pecl_)?http$|propro|protobuf|psr|raphf|rdkafka|redis|swoole|xdebug|xdebug2|yaml|zmq)/.test( version_extension ): @@ -39,6 +40,7 @@ export async function addExtensionDarwin( case /^(5\.6|7\.[0-3])phalcon3$|^7\.[2-4]phalcon4$/.test( version_extension ): + case /(7\.[0-4]|8\.0])vips/.test(version_extension): command = 'add_brew_extension ' + extension_name.replace('pecl_', ''); break; // match sqlite