From: Nicolas LÅ“uillet Date: Thu, 27 Oct 2016 07:53:09 +0000 (+0200) Subject: Added require.sh to check if composer is installed X-Git-Tag: 2.1.3~17^2~1 X-Git-Url: https://git.immae.eu/?p=github%2Fwallabag%2Fwallabag.git;a=commitdiff_plain;h=9998c725330b4a99d6d12df60ac8234052e80b6a Added require.sh to check if composer is installed --- 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))