Skip to content

Commit 508629f

Browse files
authored
Merge pull request #830 from dimitrovmaksim/graph_test_fix_mac_m1
Graph test: Match against "Apple processor" for M1 chips
2 parents 22f9a50 + ba4b115 commit 508629f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/commands/test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ async function getPlatform(logsOpt) {
125125
const type = os.type()
126126
const arch = os.arch()
127127
const cpuCore = os.cpus()[0]
128-
const isM1 = cpuCore.model.includes("Apple M1")
128+
const isM1 = (arch === 'arm64' && /Apple (M1|processor)/.test(cpuCore.model))
129129
const linuxInfo = type === 'Linux' ? await getLinuxInfo() : new Map()
130130
const linuxDistro = linuxInfo.get('name')
131131
const release = linuxInfo.get('version') || os.release()
@@ -135,7 +135,7 @@ async function getPlatform(logsOpt) {
135135
print.info(`OS type: ${linuxDistro || type}\nOS arch: ${arch}\nOS release: ${release}\nOS major version: ${majorVersion}\nCPU model: ${cpuCore.model}`)
136136
}
137137

138-
if (arch === 'x64' || (arch === 'arm64' && isM1)) {
138+
if (arch === 'x64' || isM1) {
139139
if (type === 'Darwin') {
140140
if (majorVersion === 19) {
141141
return 'binary-macos-10.15'
@@ -168,7 +168,7 @@ async function getLinuxInfo() {
168168
infoArray.forEach((val) => {
169169
infoMap.set(val[0].toLowerCase(), val[1])
170170
});
171-
171+
172172
return infoMap
173173
} catch (error) {
174174
print.error(`Error fetching the Linux version:\n ${error}`)

0 commit comments

Comments
 (0)