2019-06-24 11:40:20 +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() {
|
2019-07-08 18:17:11 +00:00
|
|
|
echo "$(tput setaf "$1")$2$(tput sgr0)"
|
2019-06-24 11:40:20 +00:00
|
|
|
}
|
|
|
|
|
2019-07-08 18:17:11 +00:00
|
|
|
if [ ! -d "packages/" ]; then
|
|
|
|
output 1 "./packages doesn't exist!"
|
|
|
|
output 1 "run \"composer install\" before proceed."
|
|
|
|
fi
|
|
|
|
|
2019-06-24 14:29:26 +00:00
|
|
|
# Autoloader
|
|
|
|
output 3 "Updating autoloader classmaps..."
|
2019-06-25 14:57:44 +00:00
|
|
|
composer dump-autoload
|
2019-06-24 14:29:26 +00:00
|
|
|
output 2 "Done"
|
|
|
|
|
|
|
|
# Convert textdomains
|
2020-02-04 14:45:40 +00:00
|
|
|
output 3 "Updating package PHP textdomains..."
|
2019-06-24 11:40:20 +00:00
|
|
|
|
2019-06-24 14:29:26 +00:00
|
|
|
# Replace text domains within packages with woocommerce
|
2020-01-30 17:26:14 +00:00
|
|
|
npm run packages:fix:textdomain
|
2019-07-08 18:19:48 +00:00
|
|
|
output 2 "Done!"
|
2020-02-04 14:45:40 +00:00
|
|
|
|
|
|
|
output 3 "Updating package JS textdomains..."
|
|
|
|
find ./packages/woocommerce-blocks -iname '*.js' -exec sed -i.bak -e "s/'woo-gutenberg-products-block'/'woocommerce'/g" -e "s/\"woo-gutenberg-products-block\"/'woocommerce'/g" {} \;
|
2020-06-04 10:39:26 +00:00
|
|
|
find ./packages/woocommerce-blocks -iname '*.js' -exec sed -i.bak -e "s/'woocommerce-admin'/'woocommerce'/g" -e "s/\"woocommerce-admin\"/'woocommerce'/g" {} \;
|
2020-04-29 21:58:59 +00:00
|
|
|
find ./packages/woocommerce-admin -iname '*.js' -exec sed -i.bak -e "s/'woocommerce-admin'/'woocommerce'/g" -e "s/\"woocommerce-admin\"/'woocommerce'/g" {} \;
|
2019-06-24 11:40:20 +00:00
|
|
|
|
|
|
|
# Cleanup backup files
|
|
|
|
find ./packages -name "*.bak" -type f -delete
|
2019-07-08 18:19:48 +00:00
|
|
|
output 2 "Done!"
|