Polish nanopb hack
diff --git a/gRPC-Core.podspec b/gRPC-Core.podspec
index dbebd4c..a19286c 100644
--- a/gRPC-Core.podspec
+++ b/gRPC-Core.podspec
@@ -1264,7 +1264,7 @@
# TODO (mxyan): Instead of this hack, add include path "third_party" to C core's include path?
s.prepare_command = <<-END_OF_COMMAND
- find src/core/ -type f ! -path '*.grpc_back' -exec sed -E -i'.grpc_back' 's;#include "(pb(_.*)?\\.h)";#include <nanopb/\\1>;g' {} \\\;
- find src/core/ -type f -path '*.grpc_back' | xargs rm
+ find src/core/ -type f ! -path '*.grpc_back' -print0 | xargs -0 -L1 sed -E -i'.grpc_back' 's;#include "(pb(_.*)?\\.h)";#include <nanopb/\\1>;g'
+ find src/core/ -type f -path '*.grpc_back' -print0 | xargs -0 rm
END_OF_COMMAND
end
diff --git a/templates/gRPC-Core.podspec.template b/templates/gRPC-Core.podspec.template
index 237389b..5098f35 100644
--- a/templates/gRPC-Core.podspec.template
+++ b/templates/gRPC-Core.podspec.template
@@ -220,7 +220,7 @@
# TODO (mxyan): Instead of this hack, add include path "third_party" to C core's include path?
s.prepare_command = <<-END_OF_COMMAND
- find src/core/ -type f ! -path '*.grpc_back' -exec sed -E -i'.grpc_back' 's;#include "(pb(_.*)?\\.h)";#include <nanopb/\\1>;g' {} \\\;
- find src/core/ -type f -path '*.grpc_back' | xargs rm
+ find src/core/ -type f ! -path '*.grpc_back' -print0 | xargs -0 -L1 sed -E -i'.grpc_back' 's;#include "(pb(_.*)?\\.h)";#include <nanopb/\\1>;g'
+ find src/core/ -type f -path '*.grpc_back' -print0 | xargs -0 rm
END_OF_COMMAND
end