Skip to content
This repository has been archived by the owner on Jan 6, 2021. It is now read-only.

Commit

Permalink
v1.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Kent C. Dodds committed Nov 11, 2015
2 parents 957eb8a + 40f145b commit b870baa
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
4 changes: 2 additions & 2 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'd

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

var _child_process = require('child_process');
var _crossSpawn = require('cross-spawn');

var _addToPathDistGetPathVar = require('add-to-path/dist/get-path-var');

Expand All @@ -30,7 +30,7 @@ function crossEnv(args) {
var env = _getCommandArgsAndEnvVars2[2];

if (command) {
return (0, _child_process.spawn)(command, commandArgs, { stdio: 'inherit', env: env });
return (0, _crossSpawn.spawn)(command, commandArgs, { stdio: 'inherit', env: env });
}
}

Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cross-env",
"version": "1.0.1",
"version": "1.0.2",
"description": "Run commands that set environment variables across platforms",
"main": "src/index.js",
"bin": {
Expand Down Expand Up @@ -39,6 +39,7 @@
"chai": "3.3.0",
"codecov.io": "0.1.6",
"commitizen": "1.0.5",
"cross-spawn": "2.0.0",
"cz-conventional-changelog": "1.1.2",
"eslint": "1.5.1",
"eslint-config-kentcdodds": "4.0.1",
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {spawn} from 'child_process';
import {spawn} from 'cross-spawn';
import getPathVar from 'add-to-path/dist/get-path-var';
export default crossEnv;

Expand Down
10 changes: 5 additions & 5 deletions src/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ chai.use(sinonChai);

const {expect} = chai;
const proxied = {
child_process: { // eslint-disable-line camelcase
'cross-spawn': {
spawn: sinon.spy(() => 'spawn-returned')
}
};
Expand All @@ -17,7 +17,7 @@ const crossEnv = proxyquire('./index', proxied);
describe(`cross-env`, () => {

beforeEach(() => {
proxied.child_process.spawn.reset();
proxied['cross-spawn'].spawn.reset();
});

it(`should set environment variables and run the remaining command`, () => {
Expand All @@ -30,7 +30,7 @@ describe(`cross-env`, () => {

it(`should do nothing given no command`, () => {
crossEnv([]);
expect(proxied.child_process.spawn).to.have.not.been.called;
expect(proxied['cross-spawn'].spawn).to.have.not.been.called;
});

function testEnvSetting(...envSettings) {
Expand All @@ -42,8 +42,8 @@ describe(`cross-env`, () => {
});

expect(ret, 'returns what spawn returns').to.equal('spawn-returned');
expect(proxied.child_process.spawn).to.have.been.calledOnce;
expect(proxied.child_process.spawn).to.have.been.calledWith(
expect(proxied['cross-spawn'].spawn).to.have.been.calledOnce;
expect(proxied['cross-spawn'].spawn).to.have.been.calledWith(
'echo', ['hello world'], {stdio: 'inherit', env}
);
}
Expand Down

0 comments on commit b870baa

Please sign in to comment.