Fix infinite loop while find and sed

This commit is contained in:
Fly3949 2022-10-04 02:42:05 +08:00 committed by GitHub
parent 64ef15420a
commit 819c0ebf37
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -48,9 +48,9 @@ fi
cd $APP/dist
if [ ! -z "$STATIC_CDN_HOST" ]; then
find . -name "*.*" -type f -exec sed -i "s/__STATIC_CDN_HOST__/\/$STATIC_CDN_HOST/g" {} \;
find . -name "*.*" -type f -print0 | xargs -0 sed -i "s/__STATIC_CDN_HOST__/\/$STATIC_CDN_HOST/g"
else
find . -name "*.*" -type f -exec sed -i "s/__STATIC_CDN_HOST__\///g" {} \;
find . -name "*.*" -type f -print0 | xargs -0 sed -i "s/__STATIC_CDN_HOST__\///g"
fi
cd $APP