Merge pull request #118 from probot/version-check

Ensure node version is satisfied
This commit is contained in:
Brandon Keepers 2017-04-08 17:37:17 -05:00 committed by GitHub
commit 7d367bda0d
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]')