This repository has been archived by the owner on Dec 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 68
/
Copy pathrubedo.sh
executable file
·58 lines (52 loc) · 1.66 KB
/
rubedo.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/bin/bash
SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
SOURCE="$(readlink "$SOURCE")"
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
done
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
cd $DIR
#Try if CMDS exist
command -v php > /dev/null || { echo "php command not found."; exit 1; }
HASCURL=1;
command -v curl > /dev/null || HASCURL=0;
if [ -z "$1" ]
then
DEVMODE="--no-dev"
else
DEVMODE=$1;
fi
# Get last composer
if [ -f composer.phar ]
then
php composer.phar self-update
else
if [[ HASCURL == 1 ]]
then
curl -sS https://getcomposer.org/installer | php
else
php -r "eval('?>'.file_get_contents('https://getcomposer.org/installer'));"
fi
fi
# Install or update with composer
if [ -f composer.lock ]
then
php composer.phar $DEVMODE update -o;
COMPOSER=composer.front.json php composer.phar $DEVMODE update;
else
php composer.phar $DEVMODE install -o;
COMPOSER=composer.front.json php composer.phar $DEVMODE install;
fi
# Install or update extensions
if [ -f composer.extensions.json ]
then
if [ -f composer.extensions.lock ]
then
COMPOSER=composer.extensions.json php composer.phar $DEVMODE update -o;
else
COMPOSER=composer.extensions.json php composer.phar $DEVMODE install -o;
fi
fi
# Set Rights
vendor/bin/phing set-rights;