2020-09-21 14:20:18 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
. $(dirname "$0")/output.sh
|
|
|
|
|
|
|
|
output 6 "Prefixing the appropriate vendor namespaces with Automattic\WooCommerce\Vendor"
|
|
|
|
|
2020-09-22 07:19:12 +00:00
|
|
|
# Replace "League\Container" in "use" and "namespace" with "Automattic\WooCommerce\Vendor\League\Container".
|
|
|
|
REGEX='s/^[[:space:]]*(use|namespace)[[:space:]]*(League\\Container)/\1 Automattic\\WooCommerce\\Vendor\\\2/g'
|
|
|
|
|
|
|
|
# macOS and Linux have a slightly different syntax for 'sed -i' so we need two versions.
|
|
|
|
if [[ "$OSTYPE" == "darwin"* ]]; then
|
|
|
|
find ./vendor/league/container -type f -name '*.php' -print0 | xargs -0 sed -i '' -E -e "$REGEX"
|
|
|
|
else
|
|
|
|
find ./vendor/league/container -type f -name '*.php' -print0 | xargs -0 sed -i -E -e "$REGEX"
|
|
|
|
fi
|