From 44d81f983056c06a11e04e43aa61bf7726912278 Mon Sep 17 00:00:00 2001 From: Shivam Mathur Date: Wed, 17 Aug 2022 14:41:01 +0530 Subject: [PATCH] Fix symfony support --- src/scripts/tools/symfony.sh | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/scripts/tools/symfony.sh b/src/scripts/tools/symfony.sh index b7c0ccef..559a0676 100644 --- a/src/scripts/tools/symfony.sh +++ b/src/scripts/tools/symfony.sh @@ -1,12 +1,16 @@ -add_symfony() { - if [ "$(uname -s)" = "Linux" ]; then - echo 'deb [trusted=yes] https://repo.symfony.com/apt/ /' | sudo tee /etc/apt/sources.list.d/symfony-cli.list >/dev/null 2>&1 - update_lists symfony repo.symfony.com - install_packages symfony-cli - elif [ "$(uname -s)" = "Darwin" ]; then +add_symfony_helper() { + if command -v brew >/dev/null; then add_brew_tap symfony-cli/homebrew-tap - brew install symfony-cli/tap/symfony-cli >/dev/null 2>&1 + brew install symfony-cli/tap/symfony-cli + else + arch=$(dpkg --print-architecture) + get -s -n "" "https://github.com/symfony-cli/symfony-cli/releases/latest/download/symfony-cli_linux_$arch.tar.gz" | sudo tar -xz -C "${tool_path_dir:?}" + sudo chmod a+x /usr/local/bin/symfony fi +} + +add_symfony() { + add_symfony_helper >/dev/null 2>&1 symfony_path="$(command -v symfony)" if [[ -n "$symfony_path" ]]; then sudo ln -s "$symfony_path" "${tool_path_dir:?}"/symfony-cli