-
Notifications
You must be signed in to change notification settings - Fork 61
/
Copy pathbuild.sh
executable file
·36 lines (28 loc) · 1.06 KB
/
build.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
#!/bin/bash
# Check if phar-composer.phar is in the $PATH
if ! [ -x "$(command -v phar-composer.phar)" ]; then
echo "Error: phar-composer.phar command could not be found!"
echo "Make sure to download the latest release of phar composer tool: https://github.com/clue/phar-composer/releases"
echo "Make it executable and add it in a folder in your PATH"
exit 1
fi
version="dev"
date=$(date "+%Y%m%d-%H%M%S")
newfile="progpilot_${version}${date}"
echo "Progpilot builder"
echo "Did you update the version of progpilot in Console/Application.php file? (optional)"
echo "and did you update the version of progpilot in composer.json examples? (optional)"
mkdir -p ./builds
cd ./projects/phar || exit 1
# Cleanup
rm -f composer.lock
rm -rf ./vendor/
rm -rf ../../builds/*
composer install
rm -rf ./vendor/progpilot/
mkdir -p ./vendor/progpilot/package
cp -R ../../package/* ./vendor/progpilot/package
echo "Generating phar..."
php -d phar.readonly=off "$(command -v phar-composer.phar)" build .
chmod -v +x ./build.phar
mv -v ./build.phar ../../builds/"${newfile}".phar