diff --git a/gRPC-C++.podspec b/gRPC-C++.podspec index 262de72971b..39117557fce 100644 --- a/gRPC-C++.podspec +++ b/gRPC-C++.podspec @@ -663,9 +663,9 @@ Pod::Spec.new do |s| end s.prepare_command = <<-END_OF_COMMAND - find src/cpp/ -type f -exec sed -E -i'.back' 's;#include "third_party/nanopb/(.*)";#include ;g' {} \\\; - find src/cpp/ -name "*.back" -type f -delete - find src/core/ -regex ".*\.h" -type f -exec sed -E -i'.back' 's;#include "third_party/nanopb/(.*)";#include ;g' {} \\\; - find src/core/ -name "*.back" -type f -delete + find src/cpp/ -type f ! -path '*.grpc_back' -print0 | xargs -0 -L1 sed -E -i'.grpc_back' 's;#include "(pb(_.*)?\\.h)";#include ;g' + find src/cpp/ -type f -path '*.grpc_back' -print0 | xargs -0 rm + find src/core/ -type f ! -path '*.grpc_back' -print0 | xargs -0 -L1 sed -E -i'.grpc_back' 's;#include "(pb(_.*)?\\.h)";#include ;g' + find src/core/ -type f -path '*.grpc_back' -print0 | xargs -0 rm END_OF_COMMAND end diff --git a/templates/gRPC-C++.podspec.template b/templates/gRPC-C++.podspec.template index 12d5fc17d43..2853bb63ab0 100644 --- a/templates/gRPC-C++.podspec.template +++ b/templates/gRPC-C++.podspec.template @@ -196,9 +196,9 @@ end s.prepare_command = <<-END_OF_COMMAND - find src/cpp/ -type f -exec sed -E -i'.back' 's;#include "third_party/nanopb/(.*)";#include ;g' {} \\\; - find src/cpp/ -name "*.back" -type f -delete - find src/core/ -regex ".*\.h" -type f -exec sed -E -i'.back' 's;#include "third_party/nanopb/(.*)";#include ;g' {} \\\; - find src/core/ -name "*.back" -type f -delete + find src/cpp/ -type f ! -path '*.grpc_back' -print0 | xargs -0 -L1 sed -E -i'.grpc_back' 's;#include "(pb(_.*)?\\.h)";#include ;g' + find src/cpp/ -type f -path '*.grpc_back' -print0 | xargs -0 rm + find src/core/ -type f ! -path '*.grpc_back' -print0 | xargs -0 -L1 sed -E -i'.grpc_back' 's;#include "(pb(_.*)?\\.h)";#include ;g' + find src/core/ -type f -path '*.grpc_back' -print0 | xargs -0 rm END_OF_COMMAND end