From a8f06130ef8d4937d9d012cf36a9d1ae9ea4679c Mon Sep 17 00:00:00 2001 From: AnthonyAxenov Date: Sun, 9 Jan 2022 16:56:25 +0800 Subject: [PATCH] =?UTF-8?q?=D0=9A=D0=BE=D1=80=D1=80=D0=B5=D0=BA=D1=82?= =?UTF-8?q?=D0=B8=D1=80=D0=BE=D0=B2=D0=BA=D0=B0=20composer?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install/720-composer.sh | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/install/720-composer.sh b/install/720-composer.sh index d6655a3..6bff97e 100755 --- a/install/720-composer.sh +++ b/install/720-composer.sh @@ -1,10 +1,17 @@ #!/bin/bash -. "../src/01-common.sh" || exit 5 -title "Installing composer..." +echo +echo "===============================================" +echo "Installing composer..." +echo "===============================================" +echo + +installed() { + command -v "$1" >/dev/null 2>&1 +} if installed "php"; then if installed "composer"; then - warning "You already have composer installed - removing to install actual version" + echo "WARNING: You already have composer installed - removing to install actual version" sudo apt remove -y --autoremove composer sudo rm -f /bin/composer sudo rm -f /usr/bin/composer @@ -26,9 +33,9 @@ if installed "php"; then sudo cp /usr/src/composer/composer.phar /usr/local/bin/composer cd - >/dev/null sudo rm -rf /usr/src/composer/ - installed "composer" && success "composer installed!" + installed "composer" && composer --version else - warning "*** You need to have php installed" + echo "WARNING: You need to have php installed" fi # title "Installing composer.phar in home dir..."