From 65ccfb36dcad821d6e950c3e21f60ec83a2aa9b3 Mon Sep 17 00:00:00 2001 From: Shivam Mathur Date: Fri, 17 Jan 2020 05:51:46 +0530 Subject: [PATCH] Fix extensions.ts --- __tests__/extensions.test.ts | 3 +++ dist/index.js | 9 ++++++--- src/extensions.ts | 9 ++++++--- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/__tests__/extensions.test.ts b/__tests__/extensions.test.ts index cb165150..a89ed03f 100644 --- a/__tests__/extensions.test.ts +++ b/__tests__/extensions.test.ts @@ -91,6 +91,9 @@ describe('Extension tests', () => { darwin = await extensions.addExtension('xdebug', '5.6', 'darwin'); expect(darwin).toContain('sudo pecl install xdebug-2.5.5'); + darwin = await extensions.addExtension('xdebug', '7.0', 'darwin'); + expect(darwin).toContain('sudo pecl install xdebug-2.9.0'); + darwin = await extensions.addExtension('xdebug', '7.2', 'darwin'); expect(darwin).toContain('sudo pecl install xdebug'); diff --git a/dist/index.js b/dist/index.js index c336d8c7..1c4ae660 100644 --- a/dist/index.js +++ b/dist/index.js @@ -2537,6 +2537,9 @@ function addExtensionDarwin(extension_csv, version, pipe) { case /5\.6xdebug/.test(version_extension): install_command = 'sudo pecl install xdebug-2.5.5' + pipe; break; + case /7\.0xdebug/.test(version_extension): + install_command = 'sudo pecl install xdebug-2.9.0' + pipe; + break; case /5\.6redis/.test(version_extension): install_command = 'sudo pecl install redis-2.2.8' + pipe; break; @@ -2633,11 +2636,11 @@ function addExtensionLinux(extension_csv, version, pipe) { break; // match 7.0xdebug..7.4xdebug case /^7\.[0-4]xdebug$/.test(version_extension): - script = '\nupdate_extension xdebug 2.9.0' + pipe; + script += '\nupdate_extension xdebug 2.9.0' + pipe; return; // match 7.0phalcon3..7.3phalcon3 and 7.2phalcon4...7.4phalcon4 case /^7\.[0-3]phalcon3$|^7\.[2-4]phalcon4$/.test(version_extension): - install_command = + script += 'sh ' + path.join(__dirname, '../src/scripts/ext/phalcon.sh') + ' ' + @@ -2645,7 +2648,7 @@ function addExtensionLinux(extension_csv, version, pipe) { ' ' + version + pipe; - break; + return; default: install_command = 'sudo DEBIAN_FRONTEND=noninteractive apt-get install -y php' + diff --git a/src/extensions.ts b/src/extensions.ts index 835df00f..8081b052 100644 --- a/src/extensions.ts +++ b/src/extensions.ts @@ -24,6 +24,9 @@ export async function addExtensionDarwin( case /5\.6xdebug/.test(version_extension): install_command = 'sudo pecl install xdebug-2.5.5' + pipe; break; + case /7\.0xdebug/.test(version_extension): + install_command = 'sudo pecl install xdebug-2.9.0' + pipe; + break; case /5\.6redis/.test(version_extension): install_command = 'sudo pecl install redis-2.2.8' + pipe; break; @@ -120,11 +123,11 @@ export async function addExtensionLinux( break; // match 7.0xdebug..7.4xdebug case /^7\.[0-4]xdebug$/.test(version_extension): - script = '\nupdate_extension xdebug 2.9.0' + pipe; + script += '\nupdate_extension xdebug 2.9.0' + pipe; return; // match 7.0phalcon3..7.3phalcon3 and 7.2phalcon4...7.4phalcon4 case /^7\.[0-3]phalcon3$|^7\.[2-4]phalcon4$/.test(version_extension): - install_command = + script += 'sh ' + path.join(__dirname, '../src/scripts/ext/phalcon.sh') + ' ' + @@ -132,7 +135,7 @@ export async function addExtensionLinux( ' ' + version + pipe; - break; + return; default: install_command = 'sudo DEBIAN_FRONTEND=noninteractive apt-get install -y php' +