From eefb1319405c585afb0fc4903c83aa8b64a78116 Mon Sep 17 00:00:00 2001 From: itsspriyansh Date: Sun, 25 Feb 2024 03:50:18 +0530 Subject: [PATCH] added --standalone flag for android setup --- src/commands/android/constants.ts | 4 ++++ src/commands/android/index.ts | 14 ++++++++------ src/index.ts | 2 +- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/commands/android/constants.ts b/src/commands/android/constants.ts index 513b174..b6e9b24 100644 --- a/src/commands/android/constants.ts +++ b/src/commands/android/constants.ts @@ -24,6 +24,10 @@ export const AVAILABLE_OPTIONS: AvailableOptions = { appium: { alias: [], description: 'Make sure the final setup works with Appium out-of-the-box.' + }, + standalone: { + alias: [], + description: 'Downloads Android SDK and sets up emulator with Android v11.' } }; diff --git a/src/commands/android/index.ts b/src/commands/android/index.ts index f1d5327..60293e8 100644 --- a/src/commands/android/index.ts +++ b/src/commands/android/index.ts @@ -858,12 +858,14 @@ export class AndroidSetup { // TODO: add major version of Chrome as suffix to chromedriver. // Or, check the version of existing chromedriver using --version. - Logger.log('Checking if chromedriver is already downloaded...'); - if (fs.existsSync(chromedriverDownloadPath)) { - Logger.log(` ${colors.green(symbols().ok)} chromedriver already present at '${chromedriverDownloadPath}'\n`); - } else { - Logger.log(` ${colors.red(symbols().fail)} chromedriver not found at '${chromedriverDownloadPath}'\n`); - downloadChromedriver = true; + if (!this.options.standalone) { + Logger.log('Checking if chromedriver is already downloaded...'); + if (fs.existsSync(chromedriverDownloadPath)) { + Logger.log(` ${colors.green(symbols().ok)} chromedriver already present at '${chromedriverDownloadPath}'\n`); + } else { + Logger.log(` ${colors.red(symbols().fail)} chromedriver not found at '${chromedriverDownloadPath}'\n`); + downloadChromedriver = true; + } } } else if (stdout !== null) { Logger.log(` ${colors.red(symbols().fail)} Chrome browser not found in the AVD.\n`); diff --git a/src/index.ts b/src/index.ts index c15ec74..f881803 100644 --- a/src/index.ts +++ b/src/index.ts @@ -9,7 +9,7 @@ export const run = () => { try { const argv = process.argv.slice(2); const {_: args, ...options} = minimist(argv, { - boolean: ['install', 'setup', 'help', 'appium'], + boolean: ['install', 'setup', 'help', 'appium', 'standalone'], alias: { help: 'h', mode: 'm',