From d99c8732ba9d65f4da9982de57715e9ccd899f29 Mon Sep 17 00:00:00 2001 From: Shivam Mathur Date: Fri, 14 Feb 2020 15:09:56 +0530 Subject: [PATCH] Fix extension_version on windows --- dist/index.js | 8 +------- src/extensions.ts | 8 +------- src/scripts/win32.ps1 | 5 ++++- 3 files changed, 6 insertions(+), 15 deletions(-) diff --git a/dist/index.js b/dist/index.js index 16ccc9d5..8aa9c986 100644 --- a/dist/index.js +++ b/dist/index.js @@ -2765,13 +2765,7 @@ function addExtensionWindows(extension_csv, version, pipe) { break; // match exact versions case /.*-\d+\.\d+\.\d+/.test(version_extension): - script += - '\nAdd-Extension ' + - extension_name + - ' ' + - 'stable' + - ' ' + - stability; + script += '\nAdd-Extension ' + extension_name + ' stable ' + stability; return; // match 7.0phalcon3...7.3phalcon3 and 7.2phalcon4...7.4phalcon4 case /^7\.[0-3]phalcon3$|^7\.[2-4]phalcon4$/.test(version_extension): diff --git a/src/extensions.ts b/src/extensions.ts index a68f8406..a434b887 100644 --- a/src/extensions.ts +++ b/src/extensions.ts @@ -104,13 +104,7 @@ export async function addExtensionWindows( break; // match exact versions case /.*-\d+\.\d+\.\d+/.test(version_extension): - script += - '\nAdd-Extension ' + - extension_name + - ' ' + - 'stable' + - ' ' + - stability; + script += '\nAdd-Extension ' + extension_name + ' stable ' + stability; return; // match 7.0phalcon3...7.3phalcon3 and 7.2phalcon4...7.4phalcon4 case /^7\.[0-3]phalcon3$|^7\.[2-4]phalcon4$/.test(version_extension): diff --git a/src/scripts/win32.ps1 b/src/scripts/win32.ps1 index f538c1be..20d5099b 100644 --- a/src/scripts/win32.ps1 +++ b/src/scripts/win32.ps1 @@ -55,7 +55,10 @@ Function Add-Extension { } } else { - Install-PhpExtension -Extension $extension -MinimumStability $mininum_stability -Version $extension_version -Path $php_dir + if($extension_version -ne '') { + $extension = "$extension -Version $extension_version" + } + Install-PhpExtension -Extension $extension -MinimumStability $mininum_stability -Path $php_dir Add-Log $tick $extension "Installed and enabled" } }