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

Discussion: require both keep and remove options for flags for non-interactive command line usage #29

Open
wilau2 opened this issue Nov 7, 2019 · 3 comments

Comments

@wilau2
Copy link
Contributor

wilau2 commented Nov 7, 2019

Reading the readme, I was under the impression that: react-native clean-project was interactive and that react-native-clean-project + flags would be non-interactive.

Should we have options supporting both keep & remove something for all flags in order to be able to use it from the command line without interactions?

react-native-clean-project --keep-brew --keep-pods --keep-iOS-build --keep-android-build

example:

const askAndroid = () =>
  new Promise(resolve => {
    if (args.includes('--remove-android-build')) {
      wipeAndroidBuild = true;
      return resolve();
    }
    if (args.includes('--keep-android-build')) {
      wipeAndroidBuild = false;
      return resolve();
    }
    return askQuestion('Wipe android build folder? (Y/n) ', answer => {
      wipeAndroidBuild = checkAnswer(answer, askAndroid, resolve);
    });
  });
@miyacoz
Copy link

miyacoz commented Apr 27, 2021

it's so lovely to have. i actually got kinda shocked a while ago when i put react-native-clean-project with current available options, and on/off flags to some of them (which i carelessly thought they existed; something like --remove-iOS-build=false) for a script, but of course it showed prompts, though i wanted it to finished automatically.
you've already closed your PR in #30, but it looked better than nothing for me. hopefully it's reopened and merged, or someone will make another PR because i don't think i have some time to make my own PR for this around now.

@AleksandrTermenzhy
Copy link

AleksandrTermenzhy commented Mar 16, 2022

Hello!

I'd like to bring attention to this discussion once again. It would be so nice to have fully non-interactive execution while still having full control over the options.

As for now when running this command it still asks questions about pods and pods' cache:
react-native-clean-project --remove-iOS-build --remove-android-build --clean-android-project --keep-node-modules --keep-brew --keep-pods

@wiryonolau
Copy link

any update ? We have case that we don't develop for IOS, so I remove all ios dependency ( folder ) which cause this to error

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

No branches or pull requests

5 participants