Skip to content

Commit 546d05e

Browse files
authored
Merge pull request #14 from flippidippi/master
Switch to using `--version` by default
2 parents 071d078 + 9ab347f commit 546d05e

File tree

3 files changed

+5
-10
lines changed

3 files changed

+5
-10
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# check-engines [![Build Status](https://secure.travis-ci.org/kruppel/check-engines.svg?branch=master)](https://travis-ci.org/kruppel/check-engines)
22

3-
Utility to verify that engine versions (node, npm, iojs, yarn) satisfy semver
4-
constraints specified in package.json.
3+
Utility to verify that engine versions (node, npm, iojs, yarn, dotnet, etc.) satisfy semver
4+
constraints specified in `package.json`.
55

66
## Usage
77

lib/engine-test.js

+1-6
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@ var crossSpawn = require('cross-spawn');
22
var format = require('util').format;
33
var semver = require('semver');
44

5-
var ENGINE_TEST_ARGS = {
6-
yarn: '--version'
7-
};
8-
95
function EngineTest(type) {
106
this.type = type;
117
this.isNode = type === 'node' || type === 'iojs';
@@ -51,8 +47,7 @@ EngineTest.prototype.getVersion = function(callback) {
5147
}
5248

5349
var result = '';
54-
var flag = ENGINE_TEST_ARGS[this.type] || '-v';
55-
var version = crossSpawn.spawn(this.type, [flag], {shell: true});
50+
var version = crossSpawn.spawn(this.type, ['--version'], {shell: true});
5651

5752
version.stdout.on('data', function(data) {
5853
result += data.toString();

spec/check-engines_spec.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ describe('check-engines', function() {
2828
beforeEach(function() {
2929
mockChildProcess = new MockChildProcess();
3030
sinon.stub(crossSpawn, 'spawn');
31-
crossSpawn.spawn.withArgs('npm', ['-v'], {shell: true})
31+
crossSpawn.spawn.withArgs('npm', ['--version'], {shell: true})
3232
.returns(mockChildProcess);
3333
});
3434

@@ -195,7 +195,7 @@ describe('check-engines', function() {
195195
var invalidCommandMock = new MockChildProcess();
196196

197197
crossSpawn.spawn.withArgs(
198-
'this-is-not-an-executable', ['-v']
198+
'this-is-not-an-executable', ['--version']
199199
).returns(invalidCommandMock);
200200

201201
process.nextTick(function() {

0 commit comments

Comments
 (0)