aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts/update.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/update.sh')
-rwxr-xr-xscripts/update.sh30
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 @@
5IGNORE_ROOT_ARG="--ignore-root-warning" 5IGNORE_ROOT_ARG="--ignore-root-warning"
6IGNORE_ROOT=0 6IGNORE_ROOT=0
7 7
8if [ "$1" == "$IGNORE_ROOT_ARG" ]; then 8while :; do
9 IGNORE_ROOT=1 9 case $1 in
10fi 10 $IGNORE_ROOT_ARG) IGNORE_ROOT=1
11 ;;
12 *[a-zA-Z]) ENV=$1
13 ;;
14 *) break
15 ;;
16 esac
17 shift
18done
11 19
12# Abort running this script if root 20# Abort running this script if root
13if [ "$IGNORE_ROOT" -eq 0 ] && [ "$EUID" == "0" ]; then 21if [ "$IGNORE_ROOT" -eq 0 ] && [ "$EUID" == "0" ]; then
@@ -20,12 +28,20 @@ set -e
20set -u 28set -u
21 29
22COMPOSER_COMMAND='composer' 30COMPOSER_COMMAND='composer'
31REQUIRE_FILE='scripts/require.sh'
32
33if [ ! -f "$REQUIRE_FILE" ]; then
34 echo "Cannot find $REQUIRE_FILE"
35 exit 1
36fi
23 37
24DIR="${BASH_SOURCE}" 38. "$REQUIRE_FILE"
25if [ ! -d "$DIR" ]; then DIR="$PWD/scripts"; fi
26. "$DIR/require.sh"
27 39
28ENV=$1 40# Check for wallabag .git folder
41if [ ! -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;
44fi
29 45
30rm -rf var/cache/* 46rm -rf var/cache/*
31git fetch origin 47git fetch origin