react-native-clean-project icon indicating copy to clipboard operation
react-native-clean-project copied to clipboard

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

Open wilau2 opened this issue 5 years ago • 3 comments

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);
    });
  });

wilau2 avatar Nov 07 '19 14:11 wilau2

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.

miyacoz avatar Apr 27 '21 06:04 miyacoz

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

AleksandrTermenzhy avatar Mar 16 '22 12:03 AleksandrTermenzhy

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

wiryonolau avatar Jul 11 '22 10:07 wiryonolau