From 9568920982bf026790737980f78d5c6eeae371da Mon Sep 17 00:00:00 2001 From: Taylor Kline Date: Fri, 4 Feb 2022 17:19:29 -0600 Subject: [PATCH] feat(source/index.js): Allow specifying --auto flag to run clean-project-auto Closes pmadruga/react-native-clean-project#45 by allowing `npx react-native-clean-project --auto` to work --- source/index.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/source/index.js b/source/index.js index cb896d3..29a755f 100644 --- a/source/index.js +++ b/source/index.js @@ -2,8 +2,17 @@ const options = require('./internals/options'); const { executeTask } = require('./internals/executor'); const { tasks } = require('./internals/tasks'); +const plugin = require("./plugin"); + +const autoClean = plugin.find(p => (p.name === 'clean-project-auto')); +const args = process.argv.slice(2); async function main() { + if (args.includes('--auto')) { + autoClean.func(); + return; + } + await options.askiOS(); await options.askiOSPods(); await options.askSystemiOSPodsCache();