aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMartin Trigaux <mat@odoo.com>2019-02-14 16:40:51 +0530
committerMartin Trigaux <mat@odoo.com>2019-02-14 16:42:57 +0530
commitc01bda038e84156ffcd8cdc21025e7f3f3892fcf (patch)
treee624ff4ec7b7a87290b98773eddd87c45110d651
parentb1992b340e21b6846a1ec2ae6ddd7217f3b24fb5 (diff)
downloadwallabag-c01bda038e84156ffcd8cdc21025e7f3f3892fcf.tar.gz
wallabag-c01bda038e84156ffcd8cdc21025e7f3f3892fcf.tar.zst
wallabag-c01bda038e84156ffcd8cdc21025e7f3f3892fcf.zip
Allow optional --ignore-root-warning
Now both ./install prod --ignore-root-warning ./install --ignore-root-warning prod will work $1 was both used for the environment and the root flag Fixes wallabag/wallabag#3884
-rwxr-xr-xscripts/install.sh15
-rwxr-xr-xscripts/update.sh16
2 files changed, 22 insertions, 9 deletions
diff --git a/scripts/install.sh b/scripts/install.sh
index 8b7ea03f..de1fb8f6 100755
--- a/scripts/install.sh
+++ b/scripts/install.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
@@ -22,7 +30,6 @@ DIR="${BASH_SOURCE}"
22if [ ! -d "$DIR" ]; then DIR="$PWD/scripts"; fi 30if [ ! -d "$DIR" ]; then DIR="$PWD/scripts"; fi
23. "$DIR/require.sh" 31. "$DIR/require.sh"
24 32
25ENV=$1
26TAG=$(git describe --tags $(git rev-list --tags --max-count=1)) 33TAG=$(git describe --tags $(git rev-list --tags --max-count=1))
27 34
28git checkout $TAG 35git checkout $TAG
diff --git a/scripts/update.sh b/scripts/update.sh
index c62d104a..e86a76db 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
@@ -25,8 +33,6 @@ DIR="${BASH_SOURCE}"
25if [ ! -d "$DIR" ]; then DIR="$PWD/scripts"; fi 33if [ ! -d "$DIR" ]; then DIR="$PWD/scripts"; fi
26. "$DIR/require.sh" 34. "$DIR/require.sh"
27 35
28ENV=$1
29
30rm -rf var/cache/* 36rm -rf var/cache/*
31git fetch origin 37git fetch origin
32git fetch --tags 38git fetch --tags