pmadruga / react-native-clean-project

Automating the clean up of a React Native project
MIT License
1.17k stars 52 forks source link

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

Open wilau2 opened 4 years ago

wilau2 commented 4 years ago

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 commented 3 years ago

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 commented 2 years ago

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 commented 2 years ago

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