Skip to content

Commit 9e55956

Browse files
committed
refactor getArchitecture
1 parent 5ee1481 commit 9e55956

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

src/main/osinstaller/CxInstaller.ts

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,14 @@ export class CxInstaller {
5252
if (this.platform !== 'linux') {
5353
return 'x64';
5454
}
55-
56-
switch (process.arch) {
57-
case 'arm64':
58-
return 'arm64';
59-
case 'arm':
60-
return 'armv6';
61-
default:
62-
return 'x64';
63-
}
55+
56+
const archMap: Record<string, string> = {
57+
'arm64': 'arm64',
58+
'arm': 'armv6'
59+
};
60+
61+
// Default to 'x64' if the current architecture is not found in the map.
62+
return archMap[process.arch] || 'x64';
6463
}
6564

6665
public getExecutablePath(): string {

0 commit comments

Comments
 (0)