Skip to content

Commit

Permalink
Merge pull request #14 from flippidippi/master
Browse files Browse the repository at this point in the history
Switch to using `--version` by default
  • Loading branch information
kruppel authored Nov 1, 2022
2 parents 071d078 + 9ab347f commit 546d05e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# check-engines [![Build Status](https://secure.travis-ci.org/kruppel/check-engines.svg?branch=master)](https://travis-ci.org/kruppel/check-engines)

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

## Usage

Expand Down
7 changes: 1 addition & 6 deletions lib/engine-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@ var crossSpawn = require('cross-spawn');
var format = require('util').format;
var semver = require('semver');

var ENGINE_TEST_ARGS = {
yarn: '--version'
};

function EngineTest(type) {
this.type = type;
this.isNode = type === 'node' || type === 'iojs';
Expand Down Expand Up @@ -51,8 +47,7 @@ EngineTest.prototype.getVersion = function(callback) {
}

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

version.stdout.on('data', function(data) {
result += data.toString();
Expand Down
4 changes: 2 additions & 2 deletions spec/check-engines_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ describe('check-engines', function() {
beforeEach(function() {
mockChildProcess = new MockChildProcess();
sinon.stub(crossSpawn, 'spawn');
crossSpawn.spawn.withArgs('npm', ['-v'], {shell: true})
crossSpawn.spawn.withArgs('npm', ['--version'], {shell: true})
.returns(mockChildProcess);
});

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

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

process.nextTick(function() {
Expand Down

0 comments on commit 546d05e

Please sign in to comment.