diff --git a/.travis.yml b/.travis.yml index a78e23d..b18bae5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,5 @@ sudo: false language: node_js node_js: - - '5' + - '6' - '4' - - '0.12' - - '0.10' diff --git a/package.json b/package.json index 96b5edd..32a00cc 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ ], "dependencies": { "chalk": "^1.0.0", - "npm-run-path": "^1.0.0", + "npm-run-path": "^2.0.0", "object-assign": "^4.0.0" }, "devDependencies": { diff --git a/tasks/shell.js b/tasks/shell.js index 99e0a49..cc2c222 100644 --- a/tasks/shell.js +++ b/tasks/shell.js @@ -2,7 +2,6 @@ var exec = require('child_process').exec; var chalk = require('chalk'); var npmRunPath = require('npm-run-path'); -var objectAssign = require('object-assign'); module.exports = function (grunt) { grunt.registerMultiTask('shell', 'Run shell commands', function () { @@ -28,8 +27,7 @@ module.exports = function (grunt) { cmd = grunt.template.process(typeof cmd === 'function' ? cmd.apply(grunt, arguments) : cmd); if (opts.preferLocal === true) { - opts.execOptions.env = opts.execOptions.env || objectAssign({}, process.env); - opts.execOptions.env.PATH = npmRunPath({path: opts.execOptions.env.PATH}); + opts.execOptions.env = npmRunPath.env({env: opts.execOptions.env || process.env}); } var cp = exec(cmd, opts.execOptions, function (err, stdout, stderr) {