fix: infinite loop while find and sed

This commit is contained in:
Fly3949 2022-03-15 19:04:41 +08:00 committed by GitHub
parent 8dda05d8d7
commit 83c166237e
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" {} \;
grep -rl "__STATIC_CDN_HOST__" . | xargs sed -i "s/__STATIC_CDN_HOST__/\/$STATIC_CDN_HOST/g";
else
find . -name "*.*" -type f -exec sed -i "s/__STATIC_CDN_HOST__\///g" {} \;
grep -rl "__STATIC_CDN_HOST__" . | xargs sed -i "s/__STATIC_CDN_HOST__\///g";
fi
cd $APP