X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=scripts%2Fupdate.sh;h=c62d104a3353a2e1443cc31a33d4d3270f74e2cc;hb=HEAD;hp=e86a76db4729cd722cc26051a6e3a84e69b5f7a1;hpb=1e9c710fdd632c1448f75bfa2c29f1483e598d53;p=github%2Fwallabag%2Fwallabag.git diff --git a/scripts/update.sh b/scripts/update.sh index e86a76db..1f31d429 100755 --- a/scripts/update.sh +++ b/scripts/update.sh @@ -28,10 +28,20 @@ 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" + +# Check for wallabag .git folder +if [ ! -d .git ]; then + echo "Can not update because wallabag wasn't installed using git (see https://doc.wallabag.org/en/admin/upgrade.html#upgrade-on-a-shared-hosting). Aborting."; + exit 2; +fi rm -rf var/cache/* git fetch origin