Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ios clean task does not gracefully fail on linux #92

Open
mikehardy opened this issue Feb 13, 2022 · 0 comments
Open

ios clean task does not gracefully fail on linux #92

mikehardy opened this issue Feb 13, 2022 · 0 comments

Comments

@mikehardy
Copy link
Contributor

Hey @pmadruga 👋 long time no traffic from me here :-)

Today I used patch-package to patch react-native-clean-project@4.0.0 for the project I'm working on.

I'm wondering how you would feel about a PR here so that I can use one deep-clean target in package.json with a set of flags that cleans iOS build artifacts, but fails gracefully on non-Darwin machines?

Here is the diff that solved my problem (It is just wrapping the ios task in an if [ \'uname\' == "Darwin" ] really)

diff --git a/node_modules/react-native-clean-project/source/internals/tasks.js b/node_modules/react-native-clean-project/source/internals/tasks.js
index 2d71458..ed53531 100644
--- a/node_modules/react-native-clean-project/source/internals/tasks.js
+++ b/node_modules/react-native-clean-project/source/internals/tasks.js
@@ -2,7 +2,7 @@ const tasks = {
   wipeiOSBuildFolder: {
     name: 'wipe iOS build artifacts',
     command:
-      'rm -rf ios/build && (killall Xcode || true) && xcrun -k && cd ios && xcodebuild -alltargets clean && cd .. && rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang/ModuleCache" && rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang.$(whoami)/ModuleCache" && rm -fr ~/Library/Developer/Xcode/DerivedData/ && rm -fr ~/Library/Caches/com.apple.dt.Xcode/',
+      'if [ `uname` == \'Darwin\' ]; then rm -rf ios/build && (killall Xcode || true) && xcrun -k && cd ios && xcodebuild -alltargets clean && cd .. && rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang/ModuleCache" && rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang.$(whoami)/ModuleCache" && rm -fr ~/Library/Developer/Xcode/DerivedData/ && rm -fr ~/Library/Caches/com.apple.dt.Xcode/; fi',
     args: []
   },
   wipeiOSPodsFolder: {

This issue body was partially generated by patch-package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
@mikehardy and others