From 9998c725330b4a99d6d12df60ac8234052e80b6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Thu, 27 Oct 2016 09:53:09 +0200 Subject: Added require.sh to check if composer is installed --- scripts/dev.sh | 8 ++++++-- scripts/install.sh | 4 +++- scripts/require.sh | 8 ++++++++ scripts/update.sh | 4 ++++ 4 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 scripts/require.sh diff --git a/scripts/dev.sh b/scripts/dev.sh index 9b89da35..9f5b2432 100644 --- a/scripts/dev.sh +++ b/scripts/dev.sh @@ -1,6 +1,10 @@ #! /usr/bin/env bash -# You can execute this file to install wallabag dev environmnet -# eg: `sh install.sh prod` +# You can execute this file to install wallabag dev environment +# eg: `sh dev.sh` + +DIR="${BASH_SOURCE%/*}" +if [[ ! -d "$DIR" ]]; then DIR="$PWD"; fi +. "$DIR/require.sh" composer install php bin/console wallabag:install diff --git a/scripts/install.sh b/scripts/install.sh index d7b05a1e..cf966a0d 100644 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -2,7 +2,9 @@ # You can execute this file to install wallabag # eg: `sh install.sh prod` -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; } +DIR="${BASH_SOURCE%/*}" +if [[ ! -d "$DIR" ]]; then DIR="$PWD"; fi +. "$DIR/require.sh" ENV=$1 TAG=$(git describe --tags $(git rev-list --tags --max-count=1)) diff --git a/scripts/require.sh b/scripts/require.sh new file mode 100644 index 00000000..851d065d --- /dev/null +++ b/scripts/require.sh @@ -0,0 +1,8 @@ +#! /usr/bin/env bash +# File used to check dependencies + +if [ ! -f composer.phar ]; then + echo "composer.phar not found, we'll see if composer is installed globally." +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 b920a829..96a48217 100644 --- a/scripts/update.sh +++ b/scripts/update.sh @@ -2,6 +2,10 @@ # You can execute this file to update wallabag # eg: `sh update.sh prod` +DIR="${BASH_SOURCE%/*}" +if [[ ! -d "$DIR" ]]; then DIR="$PWD"; fi +. "$DIR/require.sh" + ENV=$1 TAG=$(git describe --tags $(git rev-list --tags --max-count=1)) -- cgit v1.2.3