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

Commit

Permalink
v1.0.5
Browse files Browse the repository at this point in the history
  • Loading branch information
Kent C. Dodds committed Nov 28, 2015
2 parents 7794688 + 0dd634e commit a968abc
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
8 changes: 3 additions & 5 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,11 @@ var _slicedToArray = (function () { function sliceIterator(arr, i) { var _arr =

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }

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 _crossSpawnAsync = require('cross-spawn-async');

var _managePathDistGetPathVar = require('manage-path/dist/get-path-var');
var _lodashAssign = require('lodash.assign');

var _managePathDistGetPathVar2 = _interopRequireDefault(_managePathDistGetPathVar);
var _lodashAssign2 = _interopRequireDefault(_lodashAssign);

exports['default'] = crossEnv;

Expand All @@ -36,7 +34,7 @@ function crossEnv(args) {

function getCommandArgsAndEnvVars(args) {
var command = undefined;
var envVars = _defineProperty({}, (0, _managePathDistGetPathVar2['default'])(), process.env[(0, _managePathDistGetPathVar2['default'])()]);
var envVars = (0, _lodashAssign2['default'])({}, process.env);
var commandArgs = args.slice();
while (commandArgs.length) {
var shifted = commandArgs.shift();
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cross-env",
"version": "1.0.4",
"version": "1.0.5",
"description": "Run commands that set environment variables across platforms",
"main": "src/index.js",
"bin": {
Expand Down Expand Up @@ -45,6 +45,7 @@
"eslint-plugin-mocha": "1.0.0",
"ghooks": "1.0.0",
"istanbul": "0.3.21",
"manage-path": "2.0.0",
"mocha": "2.3.3",
"proxyquire": "1.7.2",
"publish-latest": "1.1.2",
Expand All @@ -64,6 +65,6 @@
},
"dependencies": {
"cross-spawn-async": "2.0.0",
"manage-path": "2.0.0"
"lodash.assign": "^3.2.0"
}
}
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {spawn} from 'cross-spawn-async';
import getPathVar from 'manage-path/dist/get-path-var';
import assign from 'lodash.assign';
export default crossEnv;

const envSetterRegex = /(\w+)=(\w+)/;
Expand All @@ -13,7 +13,7 @@ function crossEnv(args) {

function getCommandArgsAndEnvVars(args) {
let command;
const envVars = {[getPathVar()]: process.env[getPathVar()]};
const envVars = assign({}, process.env);
const commandArgs = args.slice();
while (commandArgs.length) {
const shifted = commandArgs.shift();
Expand Down
3 changes: 2 additions & 1 deletion src/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import sinonChai from 'sinon-chai';
import sinon from 'sinon';
import proxyquire from 'proxyquire';
import getPathVar from 'manage-path/dist/get-path-var';
import assign from 'lodash.assign';
chai.use(sinonChai);

const {expect} = chai;
Expand Down Expand Up @@ -45,7 +46,7 @@ describe(`cross-env`, () => {
expect(ret, 'returns what spawn returns').to.equal('spawn-returned');
expect(proxied['cross-spawn-async'].spawn).to.have.been.calledOnce;
expect(proxied['cross-spawn-async'].spawn).to.have.been.calledWith(
'echo', ['hello world'], {stdio: 'inherit', env}
'echo', ['hello world'], {stdio: 'inherit', env: assign({}, process.env, env)}
);
}
});

0 comments on commit a968abc

Please sign in to comment.