Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[Doctor] Handle Android SDK not installed
  • Loading branch information
jmeistrich committed Sep 4, 2019
commit 087ce37e6bf3fc8bbf5fbbedacdedd9f81e19323
18 changes: 11 additions & 7 deletions packages/cli/src/commands/doctor/healthchecks/androidSDK.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,19 @@ import {logManualInstallation} from './common';
import versionRanges from '../versionRanges';
import {doesSoftwareNeedToBeFixed} from '../checkInstallation';

const installMessage = `Read more about how to update Android SDK at ${chalk.dim(
'https://developer.android.com/studio',
)}`;

export default {
label: 'Android SDK',
getDiagnosticsAsync: async ({SDKs}) => ({
needsToBeFixed: doesSoftwareNeedToBeFixed({
version: SDKs['Android SDK']['Build Tools'][0],
versionRange: versionRanges.ANDROID_NDK,
}),
needsToBeFixed:
(SDKs['Android SDK'] === 'Not Found' && installMessage) ||
doesSoftwareNeedToBeFixed({
version: SDKs['Android SDK']['Build Tools'][0],
versionRange: versionRanges.ANDROID_NDK,
}),
}),
runAutomaticFix: async ({loader, environmentInfo}) => {
const version = environmentInfo.SDKs['Android SDK'][0];
Expand All @@ -19,9 +25,7 @@ export default {

if (isNDKInstalled) {
return logManualInstallation({
message: `Read more about how to update Android SDK at ${chalk.dim(
'https://developer.android.com/studio',
)}`,
message: installMessage,
});
}

Expand Down