From c4d9a8d6d0db2be5c502e257bbeb963e3870d521 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Nicolas=20L=C5=93uillet?= Date: Thu, 27 Oct 2016 10:09:43 +0200 Subject: [PATCH] Usage of composer.phar if it's found --- scripts/dev.sh | 4 +++- scripts/install.sh | 4 +++- scripts/require.sh | 5 +++-- scripts/update.sh | 4 +++- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/scripts/dev.sh b/scripts/dev.sh index 9f5b2432..fa3b2d5d 100644 --- a/scripts/dev.sh +++ b/scripts/dev.sh @@ -2,10 +2,12 @@ # You can execute this file to install wallabag dev environment # eg: `sh dev.sh` +COMPOSER_COMMAND='composer' + DIR="${BASH_SOURCE%/*}" if [[ ! -d "$DIR" ]]; then DIR="$PWD"; fi . "$DIR/require.sh" -composer install +$COMPOSER_COMMAND install php bin/console wallabag:install php bin/console server:run diff --git a/scripts/install.sh b/scripts/install.sh index cf966a0d..7a1f02bd 100644 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -2,6 +2,8 @@ # You can execute this file to install wallabag # eg: `sh install.sh prod` +COMPOSER_COMMAND='composer' + DIR="${BASH_SOURCE%/*}" if [[ ! -d "$DIR" ]]; then DIR="$PWD"; fi . "$DIR/require.sh" @@ -10,5 +12,5 @@ ENV=$1 TAG=$(git describe --tags $(git rev-list --tags --max-count=1)) git checkout $TAG -SYMFONY_ENV=$ENV composer install --no-dev -o --prefer-dist +SYMFONY_ENV=$ENV $COMPOSER_COMMAND install --no-dev -o --prefer-dist php bin/console wallabag:install --env=$ENV diff --git a/scripts/require.sh b/scripts/require.sh index 851d065d..ddfb3dd2 100644 --- a/scripts/require.sh +++ b/scripts/require.sh @@ -3,6 +3,7 @@ if [ ! -f composer.phar ]; then echo "composer.phar not found, we'll see if composer is installed globally." + command -v composer >/dev/null 2>&1 || { echo >&2 "wallabag requires composer but it's not installed (see http://doc.wallabag.org/en/master/user/installation.html). Aborting."; exit 1; } +else + COMPOSER_COMMAND='composer.phar' fi - -command -v composer >/dev/null 2>&1 || { echo >&2 "wallabag requires composer but it's not installed (see http://doc.wallabag.org/en/master/user/installation.html). Aborting."; exit 1; } diff --git a/scripts/update.sh b/scripts/update.sh index 96a48217..45e93f36 100644 --- a/scripts/update.sh +++ b/scripts/update.sh @@ -2,6 +2,8 @@ # You can execute this file to update wallabag # eg: `sh update.sh prod` +COMPOSER_COMMAND='composer' + DIR="${BASH_SOURCE%/*}" if [[ ! -d "$DIR" ]]; then DIR="$PWD"; fi . "$DIR/require.sh" @@ -13,5 +15,5 @@ rm -rf var/cache/* git fetch origin git fetch --tags git checkout $TAG --force -SYMFONY_ENV=$ENV composer install --no-dev -o --prefer-dist +SYMFONY_ENV=$ENV $COMPOSER_COMMAND install --no-dev -o --prefer-dist php bin/console cache:clear --env=$ENV -- 2.41.0