From 08c60fceeaad2a1c645b1506ba3b4feb41285948 Mon Sep 17 00:00:00 2001 From: Shivam Mathur Date: Sun, 17 May 2020 03:39:04 +0530 Subject: [PATCH] Fix to use correct $php_dir --- __tests__/config.test.ts | 2 +- dist/index.js | 5 +---- src/config.ts | 5 +---- src/scripts/ext/blackfire.ps1 | 3 ++- src/scripts/ext/phalcon.ps1 | 3 ++- 5 files changed, 7 insertions(+), 11 deletions(-) diff --git a/__tests__/config.test.ts b/__tests__/config.test.ts index 97c23572..920ad233 100644 --- a/__tests__/config.test.ts +++ b/__tests__/config.test.ts @@ -7,7 +7,7 @@ describe('Config tests', () => { 'win32' ); expect(win32).toContain( - 'Add-Content C:\\tools\\php\\php.ini "post_max_size=256M\nshort_open_tag=On\ndate.timezone=Asia/Kolkata"' + 'Add-Content "$php_dir\\php.ini" "post_max_size=256M\nshort_open_tag=On\ndate.timezone=Asia/Kolkata"' ); win32 = await config.addINIValues( diff --git a/dist/index.js b/dist/index.js index 904ef66a..962fa3cf 100644 --- a/dist/index.js +++ b/dist/index.js @@ -2269,10 +2269,7 @@ async function addINIValuesWindows(ini_values_csv) { script += (await utils.addLog('$tick', line, 'Added to php.ini', 'win32')) + '\n'; }); - return ('Add-Content C:\\tools\\php\\php.ini "' + - ini_values.join('\n') + - '"' + - script); + return ('Add-Content "$php_dir\\php.ini" "' + ini_values.join('\n') + '"' + script); } exports.addINIValuesWindows = addINIValuesWindows; /** diff --git a/src/config.ts b/src/config.ts index b6fa736e..f445b1d2 100644 --- a/src/config.ts +++ b/src/config.ts @@ -32,10 +32,7 @@ export async function addINIValuesWindows( (await utils.addLog('$tick', line, 'Added to php.ini', 'win32')) + '\n'; }); return ( - 'Add-Content C:\\tools\\php\\php.ini "' + - ini_values.join('\n') + - '"' + - script + 'Add-Content "$php_dir\\php.ini" "' + ini_values.join('\n') + '"' + script ); } diff --git a/src/scripts/ext/blackfire.ps1 b/src/scripts/ext/blackfire.ps1 index 2b391d29..3de80037 100644 --- a/src/scripts/ext/blackfire.ps1 +++ b/src/scripts/ext/blackfire.ps1 @@ -11,7 +11,8 @@ Param ( $tick = ([char]8730) $php_dir = 'C:\tools\php' -$ext_dir = $php_dir + '\ext' +if($env:RUNNER -eq 'self-hosted') { $php_dir = "$php_dir$version" } +$ext_dir = "$php_dir\ext" $arch='x64' if ($version -lt '7.0') { $arch='x86' } $version = $version.replace('.', '') diff --git a/src/scripts/ext/phalcon.ps1 b/src/scripts/ext/phalcon.ps1 index 900b2887..d201d52b 100644 --- a/src/scripts/ext/phalcon.ps1 +++ b/src/scripts/ext/phalcon.ps1 @@ -31,7 +31,8 @@ Function Install-Phalcon() { $tick = ([char]8730) $domain = 'https://github.com' $php_dir = 'C:\tools\php' -$ext_dir = $php_dir + '\ext' +if($env:RUNNER -eq 'self-hosted') { $php_dir = "$php_dir$version" } +$ext_dir = "$php_dir\ext" $extension_version = $extension.substring($extension.Length - 1) if($extension_version -eq '4') {