Skip to content

Commit ecb728b

Browse files
committed
Add automatic box.phar installation
1 parent f4740c8 commit ecb728b

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
*.phar
33
*.bak
44
src/vendor/*
5+
vendor/*

compile.sh

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,13 @@ composer dump-autoload --optimize --no-dev
3131
## create phar
3232
cd "$SCRIPT_DIR/"
3333

34-
if hash box.phar 2>/dev/null; then
35-
BOX_PATH=$(which box.phar)
36-
elif hash box 2>/dev/null; then
37-
BOX_PATH=$(which box)
38-
else
39-
echo 'ERROR: box.phar (box-project/box2) not found'
40-
echo 'Try >> make install-box'
41-
exit 1
34+
if [[ ! -f vendor/box.phar ]]; then
35+
mkdir -p vendor
36+
wget -Ovendor/box.phar https://github.com/box-project/box2/releases/download/2.7.5/box-2.7.5.phar
4237
fi
4338

39+
BOX_PATH=vendor/box.phar
40+
4441
php -d phar.readonly=0 "$BOX_PATH" build -c box.json
4542

4643
cd "$OLD_PWD"

0 commit comments

Comments
 (0)