forked from heroku/heroku-buildpack-php
-
Notifications
You must be signed in to change notification settings - Fork 0
/
composer
executable file
·34 lines (22 loc) · 900 Bytes
/
composer
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
#!/usr/bin/env bash
# Build Path: /app/.heroku/php/
# fail hard
set -o pipefail
# fail harder
set -eu
source $(dirname $BASH_SOURCE)/_util/include/manifest.sh
OUT_PREFIX=$1
dep_formula=${0#$WORKSPACE_DIR/}
dep_name=$(basename $BASH_SOURCE)
dep_version=${dep_formula#"${dep_name}-"}
dep_package=pkg-${dep_name}-${dep_version}
dep_manifest=${dep_package}.composer.json
echo "-----> Bundling Composer (${dep_version})..."
export PATH=${OUT_PREFIX}/bin:$PATH
curl -sS https://getcomposer.org/installer | php -- --version=${dep_version}
php composer.phar --version
rm -rf ${OUT_PREFIX}/*
mkdir -p ${OUT_PREFIX}/bin
mv composer.phar ${OUT_PREFIX}/bin/composer
python $(dirname $BASH_SOURCE)/_util/include/manifest.py "heroku-sys-package" "heroku-sys/pkg-${dep_name}" "$dep_version" "${dep_formula}.tar.gz" > $dep_manifest
print_or_export_manifest_cmd "$(generate_manifest_cmd "$dep_manifest")"