Skip to content

Commit 94614b5

Browse files
committed
Fix fallthrough in arch detection
This doesn't cause any real issues, but it's incorrect: we try to read a non-existent file on Mac (which reports an annoying error) and we read an irrelevant env var on Linux which probably doesn't exist.
1 parent 87d5e8e commit 94614b5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/device.ts

+6
Original file line numberDiff line numberDiff line change
@@ -112,19 +112,25 @@ async function getRealArch() {
112112
});
113113
if (armCheck.trim() === '1') {
114114
return 'arm64';
115+
} else {
116+
break;
115117
}
116118

117119
case 'linux':
118120
const { stdout: cpuInfo } = await execAsync('cat /proc/cpuinfo');
119121
const lcCpuInfo = cpuInfo.toLowerCase();
120122
if (lcCpuInfo.includes('aarch64') || lcCpuInfo.includes('arm64')) {
121123
return 'arm64';
124+
} else {
125+
break;
122126
}
123127

124128
case 'win32':
125129
const arch = process.env.PROCESSOR_ARCHITEW6432 || process.env.PROCESSOR_ARCHITECTURE;
126130
if (arch?.toLowerCase() === 'arm64') {
127131
return 'arm64';
132+
} else {
133+
break;
128134
}
129135
}
130136
} catch (e) {

0 commit comments

Comments
 (0)