Skip to content

Commit e23103d

Browse files
committed
added semver as a major version checker
1 parent c09e600 commit e23103d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/commands/test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ const { Binary } = require('binary-install-raw')
22
const os = require('os')
33
const chalk = require('chalk')
44
const fetch = require('node-fetch')
5+
const semver = require('semver')
56

67
const HELP = `
78
${chalk.bold('graph test')} ${chalk.dim('[options]')} ${chalk.bold('<datasource>')}
@@ -54,7 +55,7 @@ function getPlatform() {
5455
const arch = os.arch();
5556
const release = os.release();
5657
const cpuCore = os.cpus()[0];
57-
const majorVersion = release.substr(0, release.indexOf('.'));
58+
const majorVersion = semver.major(release);
5859
const isM1 = cpuCore.model.includes("Apple M1");
5960

6061
if (arch === 'x64' || (arch === 'arm64' && isM1)) {

0 commit comments

Comments
 (0)