Update replace-placeholder.sh

Speed up the replacement loop

* only look at files with "$FROM" pattern
This commit is contained in:
K.C. Wong
2024-09-20 17:34:28 -07:00
committed by GitHub
parent 29b6946011
commit 7a298b2de3

View File

@@ -10,7 +10,6 @@ fi
# Only peform action if $FROM and $TO are different.
echo "Replacing all statically built instances of $FROM with $TO."
find apps/web/.next/ apps/web/public -type f |
while read file; do
sed -i "s|$FROM|$TO|g" "$file"
for file in $(egrep -r -l "${FROM}" apps/web/.next/ apps/web/public/); do
sed -i -e "s|$FROM|$TO|g" "$file"
done