Skip to content

Commit 767f9dc

Browse files
fix(doctor): update Android Studio detection path on Windows (#2430)
* fix(doctor): update Android Studio detection path on Windows * fix: rename constant
1 parent 10488b6 commit 767f9dc

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

packages/cli-doctor/src/tools/healthchecks/androidStudio.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,13 @@ export default {
2222

2323
// On Windows `doctor` installs Android Studio locally in a well-known place
2424
if (needsToBeFixed && process.platform === 'win32') {
25+
const archSuffix = process.arch === 'x64' ? '64' : '';
26+
2527
const androidStudioPath = join(
2628
getUserAndroidPath(),
2729
'android-studio',
2830
'bin',
29-
'studio.exe',
31+
`studio${archSuffix}.exe`,
3032
).replace(/\\/g, '\\\\');
3133
const {stdout} = await executeCommand(
3234
`wmic datafile where name="${androidStudioPath}" get Version`,
@@ -58,11 +60,11 @@ export default {
5860
installPath: installPath,
5961
});
6062

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

6466
await createShortcut({
65-
path: join(binFolder, `studio${prefix}.exe`),
67+
path: join(binFolder, `studio${archSuffix}.exe`),
6668
name: 'Android Studio',
6769
ico: join(binFolder, 'studio.ico'),
6870
});

0 commit comments

Comments
 (0)