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-10-30 11:05:27 +00:00
|
|
|
output 6 "Moving the appropriate vendor packages to Automattic\WooCommerce\Internal\Vendor"
|
|
|
|
|
|
|
|
# Delete the entire contents of src/Internal/Vendor, except README.md
|
|
|
|
find src/Internal/Vendor/* ! -name README.md -prune -exec rm -rf {} +
|
|
|
|
|
|
|
|
# Move the appropriate vendor packages to src/Internal/Vendor
|
|
|
|
# (see extra/mozart for configuration)
|
2020-11-05 16:19:14 +00:00
|
|
|
./vendor/bin/mozart compose || exit "$?"
|
|
|
|
|
|
|
|
output 6 "Updating autoload files"
|
|
|
|
|
|
|
|
composer dump-autoload
|