use node-version-matches module.. add node 10 to travis

This commit is contained in:
Lloyd Brookes
2018-06-28 23:44:25 +01:00
parent 480ac56a35
commit 44f10c89a6
4 changed files with 70 additions and 68 deletions

View File

@ -1,14 +1,7 @@
#!/usr/bin/env node
function validNodeVersion () {
var valid = false
try {
const semver = require('semver')
valid = semver.gte(require('process').version, '7.6.0')
} catch (err) {}
return valid
}
const nodeVersionMatches = require('node-version-matches')
if (validNodeVersion()) {
if (nodeVersionMatches('>=7.6.0')) {
require('../lib/cli-app').run()
} else {
console.log('Sorry, this app requires node v7.6.0 or above. Please upgrade https://nodejs.org/en/')