diff options
author | lizyn <zhiylin@outlook.com> | 2020-02-24 10:04:13 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-24 10:04:13 +0800 |
commit | b19df31d78d881a43bcf6b3215e5fc3781e8e8aa (patch) | |
tree | d0d9861694a4b5e5fbfdbeb53c255ecd15fe9328 /scripts/update.sh | |
parent | 4d0c632c70ea50d459c3c55ddda2e0f394dd51cb (diff) | |
parent | 04d918cae0227c06a41d27fb6533dddbf30dfe71 (diff) | |
download | wallabag-b19df31d78d881a43bcf6b3215e5fc3781e8e8aa.tar.gz wallabag-b19df31d78d881a43bcf6b3215e5fc3781e8e8aa.tar.zst wallabag-b19df31d78d881a43bcf6b3215e5fc3781e8e8aa.zip |
Merge pull request #1 from wallabag/master
Keep up with the master again
Diffstat (limited to 'scripts/update.sh')
-rwxr-xr-x | scripts/update.sh | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/scripts/update.sh b/scripts/update.sh index c62d104a..1f31d429 100755 --- a/scripts/update.sh +++ b/scripts/update.sh | |||
@@ -5,9 +5,17 @@ | |||
5 | IGNORE_ROOT_ARG="--ignore-root-warning" | 5 | IGNORE_ROOT_ARG="--ignore-root-warning" |
6 | IGNORE_ROOT=0 | 6 | IGNORE_ROOT=0 |
7 | 7 | ||
8 | if [ "$1" == "$IGNORE_ROOT_ARG" ]; then | 8 | while :; do |
9 | IGNORE_ROOT=1 | 9 | case $1 in |
10 | fi | 10 | $IGNORE_ROOT_ARG) IGNORE_ROOT=1 |
11 | ;; | ||
12 | *[a-zA-Z]) ENV=$1 | ||
13 | ;; | ||
14 | *) break | ||
15 | ;; | ||
16 | esac | ||
17 | shift | ||
18 | done | ||
11 | 19 | ||
12 | # Abort running this script if root | 20 | # Abort running this script if root |
13 | if [ "$IGNORE_ROOT" -eq 0 ] && [ "$EUID" == "0" ]; then | 21 | if [ "$IGNORE_ROOT" -eq 0 ] && [ "$EUID" == "0" ]; then |
@@ -20,12 +28,20 @@ set -e | |||
20 | set -u | 28 | set -u |
21 | 29 | ||
22 | COMPOSER_COMMAND='composer' | 30 | COMPOSER_COMMAND='composer' |
31 | REQUIRE_FILE='scripts/require.sh' | ||
32 | |||
33 | if [ ! -f "$REQUIRE_FILE" ]; then | ||
34 | echo "Cannot find $REQUIRE_FILE" | ||
35 | exit 1 | ||
36 | fi | ||
23 | 37 | ||
24 | DIR="${BASH_SOURCE}" | 38 | . "$REQUIRE_FILE" |
25 | if [ ! -d "$DIR" ]; then DIR="$PWD/scripts"; fi | ||
26 | . "$DIR/require.sh" | ||
27 | 39 | ||
28 | ENV=$1 | 40 | # Check for wallabag .git folder |
41 | if [ ! -d .git ]; then | ||
42 | 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."; | ||
43 | exit 2; | ||
44 | fi | ||
29 | 45 | ||
30 | rm -rf var/cache/* | 46 | rm -rf var/cache/* |
31 | git fetch origin | 47 | git fetch origin |