Skip to content

Commit

Permalink
small refactor.
Browse files Browse the repository at this point in the history
  • Loading branch information
garg3133 committed Aug 19, 2024
1 parent 8f0f896 commit 5c100b0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions src/commands/android/dotcommands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,20 @@ export class AndroidDotCommand {
Logger.log('Run Android SDK command line tools using the following command:');
Logger.log(colors.cyan('npx @nightwatch/mobile-helper <DOTCMD> [options|args]\n'));

Logger.log(`Available Dot Commands: ${colors.magenta(ANDROID_DOTCOMMANDS.join(', '))}\n`);
Logger.log('Example command: npx @nightwatch/mobile-helper android.emulator @nightwatch-android-11\n');
Logger.log(`Available Dot Commands: ${colors.magenta(ANDROID_DOTCOMMANDS.join(', '))}`);
Logger.log(`(Example command: ${colors.gray('npx @nightwatch/mobile-helper android.emulator @nightwatch-android-11')})\n`);

return false;
}

const javaInstalled = checkJavaInstallation(this.rootDir);

if (!javaInstalled) {
return false;
}

this.loadEnvFromDotEnv();
const sdkRootEnv = getSdkRootFromEnv(this.rootDir, this.androidHomeInGlobalEnv);

const sdkRootEnv = getSdkRootFromEnv(this.rootDir, this.androidHomeInGlobalEnv);
if (!sdkRootEnv) {
Logger.log(`Run: ${colors.cyan('npx @nightwatch/mobile-helper android --standalone')} to fix this issue.`);
Logger.log(`(Remove the ${colors.gray('--standalone')} flag from the above command if using the tool for testing.)\n`);
Expand Down
2 changes: 1 addition & 1 deletion src/constants.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export const AVAILABLE_COMMANDS = ['android', 'ios'];
export const ANDROID_DOTCOMMANDS = ['android.emulator', 'android.avdmanager', 'android.sdkmanager', 'android.adb'];
export const ANDROID_DOTCOMMANDS = ['android.emulator', 'android.avdmanager', 'android.sdkmanager', 'android.adb'];

0 comments on commit 5c100b0

Please sign in to comment.