From 673dcaff6de703dbbc2b4884d13297606efdbefc Mon Sep 17 00:00:00 2001 From: Shivam Mathur Date: Sun, 22 Dec 2019 08:01:06 +0530 Subject: [PATCH] Hotfix after phalcon4 release --- __tests__/extensions.test.ts | 6 +++--- dist/index.js | 4 ++-- src/scripts/phalcon.sh | 14 ++++++-------- 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/__tests__/extensions.test.ts b/__tests__/extensions.test.ts index 04e0c8f6..5aa82106 100644 --- a/__tests__/extensions.test.ts +++ b/__tests__/extensions.test.ts @@ -51,8 +51,8 @@ describe('Extension tests', () => { '7.2', 'linux' ); + expect(linux).toContain('phalcon.sh 3.4.x 7.2'); expect(linux).toContain('phalcon.sh master 7.2'); - expect(linux).toContain('phalcon.sh 4.0.x 7.2'); expect(linux).toContain('gearman.sh 7.2'); linux = await extensions.addExtension( @@ -60,12 +60,12 @@ describe('Extension tests', () => { '7.3', 'linux' ); + expect(linux).toContain('phalcon.sh 3.4.x 7.3'); expect(linux).toContain('phalcon.sh master 7.3'); - expect(linux).toContain('phalcon.sh 4.0.x 7.3'); expect(linux).toContain('gearman.sh 7.3'); linux = await extensions.addExtension('phalcon4, gearman', '7.4', 'linux'); - expect(linux).toContain('phalcon.sh 4.0.x 7.4'); + expect(linux).toContain('phalcon.sh master 7.4'); expect(linux).toContain('gearman.sh 7.4'); linux = await extensions.addExtension('xdebug', '7.2', 'fedora'); diff --git a/dist/index.js b/dist/index.js index f9d5c02d..eb724e3a 100644 --- a/dist/index.js +++ b/dist/index.js @@ -2270,7 +2270,7 @@ function addExtensionLinux(extension_csv, version) { install_command = 'sh ' + path.join(__dirname, '../src/scripts/phalcon.sh') + - ' master ' + + ' 3.4.x ' + version + ' >/dev/null 2>&1'; break; @@ -2280,7 +2280,7 @@ function addExtensionLinux(extension_csv, version) { install_command = 'sh ' + path.join(__dirname, '../src/scripts/phalcon.sh') + - ' 4.0.x ' + + ' master ' + version + ' >/dev/null 2>&1'; break; diff --git a/src/scripts/phalcon.sh b/src/scripts/phalcon.sh index 6b9a08d0..382f7314 100644 --- a/src/scripts/phalcon.sh +++ b/src/scripts/phalcon.sh @@ -1,8 +1,10 @@ ini_file=$(php --ini | grep "Loaded Configuration" | sed -e "s|.*:s*||" | sed "s/ //g") +ini_dir=$(php --ini | grep in: | sed -e "s|.*:s*||" | sed "s/ //g") if [ ! "$(apt-cache search php"$2"-psr)" ]; then sudo DEBIAN_FRONTEND=noninteractive add-apt-repository ppa:ondrej/php -y >/dev/null 2>&1 fi -sudo DEBIAN_FRONTEND=noninteractive apt-fast install -y php"$2"-dev php"$2"-psr +sudo DEBIAN_FRONTEND=noninteractive apt-fast install -y php"$2"-dev +sudo DEBIAN_FRONTEND=noninteractive apt-fast install -y php"$2"-psr for tool in php-config phpize; do if [ -e "/usr/bin/$tool$2" ]; then sudo update-alternatives --set $tool /usr/bin/"$tool$2" @@ -17,10 +19,6 @@ if [ ! "$(apt-cache search php"$2"-psr)" ]; then echo "extension=psr.so" >> "$ini_file" fi -if [ "$1" = "master" ]; then - sudo DEBIAN_FRONTEND=noninteractive apt-fast install -y php"$2"-phalcon -else - cd ~ && git clone --depth=1 -v https://github.com/phalcon/cphalcon.git -b "$1" - cd cphalcon/build && sudo ./install --phpize /usr/bin/phpize"$2" --php-config /usr/bin/php-config"$2" - echo "extension=phalcon.so" >> "$ini_file" -fi \ No newline at end of file +cd ~ && git clone --depth=1 -v https://github.com/phalcon/cphalcon.git -b "$1" +cd cphalcon/build && sudo ./install --phpize /usr/bin/phpize"$2" --php-config /usr/bin/php-config"$2" +echo "extension=phalcon.so" | sudo tee "$ini_dir/50-phalcon.ini" \ No newline at end of file