Handle PHP files with wp-textdomain, JS files with sed.

This commit is contained in:
Peter Fabian 2020-02-04 15:45:40 +01:00
parent 05213db8e9
commit a48b2b53c0
1 changed files with 8 additions and 1 deletions

View File

@ -26,8 +26,15 @@ composer dump-autoload
output 2 "Done"
# Convert textdomains
output 3 "Updating package textdomains..."
output 3 "Updating package PHP textdomains..."
# Replace text domains within packages with woocommerce
npm run packages:fix:textdomain
output 2 "Done!"
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" {} \;
# Cleanup backup files
find ./packages -name "*.bak" -type f -delete
output 2 "Done!"