| const path = require('path'); |
| const pathKey = require('path-key'); |
| module.exports = opts => { |
| path: process.env[pathKey()] |
| let pth = path.resolve(opts.cwd); |
| ret.push(path.join(pth, 'node_modules/.bin')); |
| pth = path.resolve(pth, '..'); |
| // ensure the running `node` binary is used |
| ret.push(path.dirname(process.execPath)); |
| return ret.concat(opts.path).join(path.delimiter); |
| module.exports.env = opts => { |
| const env = Object.assign({}, opts.env); |
| const path = pathKey({env}); |
| env[path] = module.exports(opts); |