File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ const { Binary } = require('binary-install-raw')
2
2
const os = require ( 'os' )
3
3
const chalk = require ( 'chalk' )
4
4
const fetch = require ( 'node-fetch' )
5
+ const semver = require ( 'semver' )
5
6
6
7
const HELP = `
7
8
${ chalk . bold ( 'graph test' ) } ${ chalk . dim ( '[options]' ) } ${ chalk . bold ( '<datasource>' ) }
@@ -53,16 +54,20 @@ function getPlatform() {
53
54
const type = os . type ( ) ;
54
55
const arch = os . arch ( ) ;
55
56
const release = os . release ( ) ;
56
- const majorVersion = release . substr ( 0 , release . indexOf ( '.' ) ) ;
57
+ const cpuCore = os . cpus ( ) [ 0 ] ;
58
+ const majorVersion = semver . major ( release ) ;
59
+ const isM1 = cpuCore . model . includes ( "Apple M1" ) ;
57
60
58
- if ( arch === 'x64' ) {
61
+ if ( arch === 'x64' || ( arch === 'arm64' && isM1 ) ) {
59
62
if ( type === 'Darwin' ) {
60
63
if ( majorVersion === '19' ) {
61
64
return 'binary-macos-10.15' ;
62
65
} else if ( majorVersion === '18' ) {
63
66
return 'binary-macos-10.14' ;
67
+ } else if ( isM1 ) {
68
+ return 'binary-macos-11-m1' ;
64
69
}
65
- return 'binary-macos-11'
70
+ return 'binary-macos-11' ;
66
71
} else if ( type === 'Linux' ) {
67
72
if ( majorVersion === '18' ) {
68
73
return 'binary-linux-18' ;
You can’t perform that action at this time.
0 commit comments