From 5108c81610a66cd1c39f93da20cc1335eff8c4d9 Mon Sep 17 00:00:00 2001 From: Shivam Mathur Date: Tue, 21 Jan 2020 01:06:31 +0530 Subject: [PATCH] Add support for ext-imagick on darwin --- __tests__/extensions.test.ts | 8 ++++++++ dist/index.js | 7 +++++++ src/extensions.ts | 7 +++++++ 3 files changed, 22 insertions(+) diff --git a/__tests__/extensions.test.ts b/__tests__/extensions.test.ts index d00d51d6..e48feb2e 100644 --- a/__tests__/extensions.test.ts +++ b/__tests__/extensions.test.ts @@ -90,6 +90,14 @@ describe('Extension tests', () => { darwin = await extensions.addExtension('redis', '7.2', 'darwin'); expect(darwin).toContain('sudo pecl install redis'); + darwin = await extensions.addExtension('imagick', '5.6', 'darwin'); + expect(darwin).toContain('brew install pkg-config imagemagick'); + expect(darwin).toContain('sudo pecl install imagick'); + + darwin = await extensions.addExtension('imagick', '7.4', 'darwin'); + expect(darwin).toContain('brew install pkg-config imagemagick'); + expect(darwin).toContain('sudo pecl install imagick'); + darwin = await extensions.addExtension( 'does_not_exist', '7.2', diff --git a/dist/index.js b/dist/index.js index 4315e3cc..60003b76 100644 --- a/dist/index.js +++ b/dist/index.js @@ -2577,6 +2577,13 @@ function addExtensionDarwin(extension_csv, version, pipe) { case /5\.6redis/.test(version_extension): install_command = 'sudo pecl install redis-2.2.8' + pipe; break; + case /[5-9]\.\dimagick/.test(version_extension): + install_command = + 'brew install pkg-config imagemagick' + + pipe + + ' && sudo pecl install imagick' + + pipe; + break; case /^7\.[0-3]phalcon3$|^7\.[2-4]phalcon4$/.test(version_extension): install_command = 'sh ' + diff --git a/src/extensions.ts b/src/extensions.ts index 383a15d6..6b47e119 100644 --- a/src/extensions.ts +++ b/src/extensions.ts @@ -30,6 +30,13 @@ export async function addExtensionDarwin( case /5\.6redis/.test(version_extension): install_command = 'sudo pecl install redis-2.2.8' + pipe; break; + case /[5-9]\.\dimagick/.test(version_extension): + install_command = + 'brew install pkg-config imagemagick' + + pipe + + ' && sudo pecl install imagick' + + pipe; + break; case /^7\.[0-3]phalcon3$|^7\.[2-4]phalcon4$/.test(version_extension): install_command = 'sh ' +