2020-10-30 11:05:27 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# Output colorized strings
|
|
|
|
#
|
|
|
|
# Color codes:
|
|
|
|
# 0 - black
|
|
|
|
# 1 - red
|
|
|
|
# 2 - green
|
|
|
|
# 3 - yellow
|
|
|
|
# 4 - blue
|
|
|
|
# 5 - magenta
|
|
|
|
# 6 - cian
|
|
|
|
# 7 - white
|
|
|
|
output() {
|
|
|
|
echo "$(tput setaf "$1")$2$(tput sgr0)"
|
|
|
|
}
|
|
|
|
|
2020-11-05 16:19:14 +00:00
|
|
|
if [ -z "$(php -r "echo version_compare(PHP_VERSION,'7.2','>=');")" ]; then
|
|
|
|
output 1 "PHP 7.2 or newer is required to run Mozart, the current PHP version is $(php -r 'echo PHP_VERSION;')"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2020-11-18 21:54:20 +00:00
|
|
|
output 6 "Building lib package"
|
2020-10-30 11:05:27 +00:00
|
|
|
|
2020-11-18 21:54:20 +00:00
|
|
|
# Clean the output directories to remove any files not present anymore
|
|
|
|
rm -rf lib/packages lib/classes
|
|
|
|
mkdir lib/packages lib/classes
|
2020-10-30 11:05:27 +00:00
|
|
|
|
2020-11-18 21:54:20 +00:00
|
|
|
# Running update on the lib package will automatically run Mozart
|
2020-11-19 08:25:48 +00:00
|
|
|
composer update -d ./lib
|
2020-11-05 16:19:14 +00:00
|
|
|
|
|
|
|
output 6 "Updating autoload files"
|
|
|
|
|
|
|
|
composer dump-autoload
|