-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall-composer.sh
executable file
·54 lines (46 loc) · 1.36 KB
/
install-composer.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
#!/usr/bin/env bash
#
# LICENCE
# This code is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This code is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# @author Thomas Urban <[email protected]>
# @copyright Copyright (c) 2010-2011, OPUS 4 development team
# @license http://www.gnu.org/licenses/gpl.html General Public License
# @version $Id$
set -e
SCRIPT_NAME="$(basename "$0")"
BASEDIR="$1"
# create base folder on demand and qualify its pathname
mkdir -p "$BASEDIR" || exit 1
cd "$BASEDIR"
BASEDIR="$(pwd)"
if [ -e composer.phar ]; then
# upgrade existing composer
php composer.phar selfupdate || {
echo "failed self-updating composer" >&2
exit 1
}
php composer.phar update || {
echo "failed updating dependencies" >&2
exit 1
}
else
# install composer
curl -s http://getcomposer.org/installer | php || {
echo "failed getting composer" >&2
exit 1
}
# install all dependencies
php composer.phar install || {
echo "failed installing dependencies" >&2
exit 1
}
fi