diff --git a/dist/index.js b/dist/index.js index 940a9d7..df7d1ab 100644 --- a/dist/index.js +++ b/dist/index.js @@ -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; @@ -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(); diff --git a/package.json b/package.json index 0145841..fd31480 100644 --- a/package.json +++ b/package.json @@ -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": { @@ -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", @@ -64,6 +65,6 @@ }, "dependencies": { "cross-spawn-async": "2.0.0", - "manage-path": "2.0.0" + "lodash.assign": "^3.2.0" } } \ No newline at end of file diff --git a/src/index.js b/src/index.js index 44c0cb4..a5b6975 100644 --- a/src/index.js +++ b/src/index.js @@ -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+)/; @@ -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(); diff --git a/src/index.test.js b/src/index.test.js index 3bea6a2..ee7e0ca 100644 --- a/src/index.test.js +++ b/src/index.test.js @@ -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; @@ -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)} ); } });