Ensure node version is satisfied

This commit is contained in:
Brandon Keepers 2017-04-08 12:46:11 -05:00
parent f3073ca8b2
commit 9a67cee2c6
No known key found for this signature in database
GPG Key ID: F9533396D5FACBF6
1 changed files with 8 additions and 0 deletions

View File

@ -1,5 +1,13 @@
#!/usr/bin/env node
const semver = require('semver');
const version = require('../package').engines.node;
if (!semver.satisfies(process.version, version)) {
console.log(`Node.js version ${version} is required. You have ${process.version}.`);
process.exit(1);
}
require('commander')
.version(require('../package').version)
.usage('<command> [options]')