From: Jérémy Benoist Date: Mon, 18 Mar 2019 08:25:00 +0000 (+0100) Subject: Merge pull request #3860 from baurmatt/fix/posix_compatibility X-Git-Tag: 2.3.8~9 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=893f107fa1451050b478838c84dc85eb295c94b7;hp=a48ff25d4c9f99dfb8ec1a9a1ae296417af6d9c9;p=github%2Fwallabag%2Fwallabag.git Merge pull request #3860 from baurmatt/fix/posix_compatibility Make dev/install/update script posix compatible --- diff --git a/scripts/dev.sh b/scripts/dev.sh index 0703ced1..28453be0 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 de1fb8f6..affa715f 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 e86a76db..3ef10439 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