From 05e2b0d1e95f8cbb8409cc543ee5d28fd2b72627 Mon Sep 17 00:00:00 2001 From: Shivam Mathur Date: Thu, 10 Oct 2019 21:13:51 +0530 Subject: [PATCH] Fix enableExtensionUnix --- lib/extensions.js | 2 +- src/extensions.ts | 2 +- src/scripts/darwin.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/extensions.js b/lib/extensions.js index 37e07ed5..0f25a97c 100644 --- a/lib/extensions.js +++ b/lib/extensions.js @@ -63,7 +63,7 @@ exports.enableExtensionWindows = enableExtensionWindows; function enableExtensionUnix(extension, os_version, log_prefix) { return __awaiter(this, void 0, void 0, function* () { return (`if [ ! "$(php -m | grep -i ${extension})" ] && [ -e "$ext_dir/${extension}.so" ]; then - echo "${yield utils.getExtensionPrefix(extension)}=${extension}" >> 'php -i | grep "Loaded Configuration" | sed -e "s|.*=>\s*||"'\n` + + echo "${yield utils.getExtensionPrefix(extension)}=${extension}" >> $ini_file\n` + (yield utils.log('Enabled ' + extension, os_version, 'success', log_prefix)) + `;\n elif [ "$(php -m | grep -i ${extension})" ]; then \n` + (yield utils.log(extension + ' was already enabled', os_version, 'success', log_prefix)) + diff --git a/src/extensions.ts b/src/extensions.ts index 78a49a36..14a8af12 100644 --- a/src/extensions.ts +++ b/src/extensions.ts @@ -75,7 +75,7 @@ export async function enableExtensionUnix( `if [ ! "$(php -m | grep -i ${extension})" ] && [ -e "$ext_dir/${extension}.so" ]; then echo "${await utils.getExtensionPrefix( extension - )}=${extension}" >> 'php -i | grep "Loaded Configuration" | sed -e "s|.*=>\s*||"'\n` + + )}=${extension}" >> $ini_file\n` + (await utils.log( 'Enabled ' + extension, os_version, diff --git a/src/scripts/darwin.sh b/src/scripts/darwin.sh index ed0a6d19..b069f385 100644 --- a/src/scripts/darwin.sh +++ b/src/scripts/darwin.sh @@ -5,7 +5,7 @@ fi brew install php@"$1" composer >/dev/null 2>&1 brew link --force --overwrite php@"$1" >/dev/null 2>&1 ini_file=$(php --ini | grep "Loaded Configuration" | sed -e "s|.*:s*||" | sed "s/ //g") -ext_dir=$(/usr/bin/php -i | grep "extension_dir => /usr" | sed -e "s|.*=> s*||") +ext_dir=$(php -i | grep "extension_dir => /usr" | sed -e "s|.*=> s*||") sudo chmod 777 "$ini_file" mkdir -p "$(pecl config-get ext_dir)" composer global require hirak/prestissimo >/dev/null 2>&1