m19c / gulp-run

Pipe to shell commands in gulp
ISC License
151 stars 25 forks source link

gulp-run modifies global process.env polluting PATH #50

Open damonmaria opened 7 years ago

damonmaria commented 7 years ago

On this line in command.js this.options.env is assigned process.env. Immediately afterwards this.options.env.PATH is modified. As process.env wasn't defensively copied when it was assigned this modifies the global process.env.PATH. So if you check process.env.PATH at the end of a gulp run it'll be full of other crap. And because of where this happens this problem applies just by defining your tasks, they don't even need to be run.

When defaulting options.env it should shallow copy process.env.