Skip to content

Commit

Permalink
fix(doctor): update Android Studio detection path on Windows (#2430)
Browse files Browse the repository at this point in the history
* fix(doctor): update Android Studio detection path on Windows

* fix: rename constant
  • Loading branch information
szymonrybczak committed Jun 27, 2024
1 parent 10488b6 commit 767f9dc
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/cli-doctor/src/tools/healthchecks/androidStudio.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@ export default {

// On Windows `doctor` installs Android Studio locally in a well-known place
if (needsToBeFixed && process.platform === 'win32') {
const archSuffix = process.arch === 'x64' ? '64' : '';

const androidStudioPath = join(
getUserAndroidPath(),
'android-studio',
'bin',
'studio.exe',
`studio${archSuffix}.exe`,
).replace(/\\/g, '\\\\');
const {stdout} = await executeCommand(
`wmic datafile where name="${androidStudioPath}" get Version`,
Expand Down Expand Up @@ -58,11 +60,11 @@ export default {
installPath: installPath,
});

const prefix = process.arch === 'x64' ? '64' : '';
const archSuffix = process.arch === 'x64' ? '64' : '';
const binFolder = join(installPath, 'android-studio', 'bin');

await createShortcut({
path: join(binFolder, `studio${prefix}.exe`),
path: join(binFolder, `studio${archSuffix}.exe`),
name: 'Android Studio',
ico: join(binFolder, 'studio.ico'),
});
Expand Down

0 comments on commit 767f9dc

Please sign in to comment.