diff options
Diffstat (limited to 'scripts/install.sh')
-rwxr-xr-x | scripts/install.sh | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/scripts/install.sh b/scripts/install.sh index 8b7ea03f..affa715f 100755 --- a/scripts/install.sh +++ b/scripts/install.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 |
@@ -17,12 +25,15 @@ if [ "$IGNORE_ROOT" -eq 0 ] && [ "$EUID" == "0" ]; then | |||
17 | fi | 25 | fi |
18 | 26 | ||
19 | COMPOSER_COMMAND='composer' | 27 | COMPOSER_COMMAND='composer' |
28 | REQUIRE_FILE='scripts/require.sh' | ||
29 | |||
30 | if [ ! -f "$REQUIRE_FILE" ]; then | ||
31 | echo "Cannot find $REQUIRE_FILE" | ||
32 | exit 1 | ||
33 | fi | ||
20 | 34 | ||
21 | DIR="${BASH_SOURCE}" | 35 | . "$REQUIRE_FILE" |
22 | if [ ! -d "$DIR" ]; then DIR="$PWD/scripts"; fi | ||
23 | . "$DIR/require.sh" | ||
24 | 36 | ||
25 | ENV=$1 | ||
26 | TAG=$(git describe --tags $(git rev-list --tags --max-count=1)) | 37 | TAG=$(git describe --tags $(git rev-list --tags --max-count=1)) |
27 | 38 | ||
28 | git checkout $TAG | 39 | git checkout $TAG |