Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix(cli): Only open Android Studio if path is set #1656

Merged
merged 1 commit into from
Jun 12, 2019
Merged
Changes from all commits
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
15 changes: 4 additions & 11 deletions cli/src/android/open.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,10 @@ export async function openAndroid(config: Config) {
await opn(dir, { app: 'android studio', wait: false });
break;
case OS.Windows:
try {
await opn(dir, { app: config.windows.androidStudioPath, wait: false });
} catch (e) {
logError('Unable to launch Android Studio. Make sure the latest version of Android Studio is installed, or,' +
'if you\'ve installed Android Studio in a custom location, configure "windowsAndroidStudioPath" ' +
'your capacitor.config.json to point to the location of studio64.exe, using JavaScript-escaped paths:\n' +

'Example:\n' +
'{\n' +
' "windowsAndroidStudioPath": "H:\\\\Android Studio\\\\bin\\\\studio64.exe"\n' +
'}');
if (config.windows.androidStudioPath) {
opn(dir, { app: config.windows.androidStudioPath, wait: false });
} else {
logError('Unable to launch Android Studio. Make sure the latest version of Android Studio is installed')
}
break;
case OS.Linux:
Expand Down