From 7c553a6017c64d98017a6010dc6e77d22ab72da4 Mon Sep 17 00:00:00 2001 From: Matthias Baur Date: Thu, 17 Jan 2019 20:04:57 +0100 Subject: [PATCH] Properly source require.sh Fixes #3571. --- scripts/dev.sh | 10 +++++++--- scripts/install.sh | 10 +++++++--- scripts/update.sh | 10 +++++++--- 3 files changed, 21 insertions(+), 9 deletions(-) diff --git a/scripts/dev.sh b/scripts/dev.sh index 0703ced1e..28453be0d 100755 --- a/scripts/dev.sh +++ b/scripts/dev.sh @@ -3,10 +3,14 @@ # eg: `sh dev.sh` COMPOSER_COMMAND='composer' +REQUIRE_FILE='scripts/require.sh' -DIR="${BASH_SOURCE}" -if [ ! -d "$DIR" ]; then DIR="$PWD/scripts"; fi -. "$DIR/require.sh" +if [ ! -f "$REQUIRE_FILE" ]; then + echo "Cannot find $REQUIRE_FILE" + exit 1 +fi + +. "$REQUIRE_FILE" $COMPOSER_COMMAND install php bin/console wallabag:install diff --git a/scripts/install.sh b/scripts/install.sh index de1fb8f65..affa715ff 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -25,10 +25,14 @@ if [ "$IGNORE_ROOT" -eq 0 ] && [ "$EUID" == "0" ]; then fi COMPOSER_COMMAND='composer' +REQUIRE_FILE='scripts/require.sh' -DIR="${BASH_SOURCE}" -if [ ! -d "$DIR" ]; then DIR="$PWD/scripts"; fi -. "$DIR/require.sh" +if [ ! -f "$REQUIRE_FILE" ]; then + echo "Cannot find $REQUIRE_FILE" + exit 1 +fi + +. "$REQUIRE_FILE" TAG=$(git describe --tags $(git rev-list --tags --max-count=1)) diff --git a/scripts/update.sh b/scripts/update.sh index e86a76db4..3ef104392 100755 --- a/scripts/update.sh +++ b/scripts/update.sh @@ -28,10 +28,14 @@ set -e set -u COMPOSER_COMMAND='composer' +REQUIRE_FILE='scripts/require.sh' -DIR="${BASH_SOURCE}" -if [ ! -d "$DIR" ]; then DIR="$PWD/scripts"; fi -. "$DIR/require.sh" +if [ ! -f "$REQUIRE_FILE" ]; then + echo "Cannot find $REQUIRE_FILE" + exit 1 +fi + +. "$REQUIRE_FILE" rm -rf var/cache/* git fetch origin