sindresorhus / grunt-shell

Run shell commands
MIT License
949 stars 126 forks source link

Problem with paths added #117

Closed soundstep closed 7 years ago

soundstep commented 7 years ago

I noticed a problem when I updated this module. Some paths are added, I guess with npm-run-path. This is very intrusive as it add general paths and makes the command running with wrong processes. In my case it takes a wrong version of ruby from /usr/bin rather than from an RVM folder. Here are the added paths from the node process:

/var/lib/jenkins/jobs/PROJECT/workspace/node_modules/.bin:
/var/lib/jenkins/jobs/PROJECT/node_modules/.bin:
/var/lib/jenkins/jobs/node_modules/.bin:
/var/lib/jenkins/node_modules/.bin:
/var/lib/node_modules/.bin:
/var/node_modules/.bin:
/node_modules/.bin:
/usr/bin:

It is very intrusive to add /usr/bin as it takes precedence to my /var/lib/jenkins/.rvm/gems/ruby-2.4.1@global/bin, making the command run with the wrong version of ruby.

Having an option not to add these paths might be a good idea? I noticed grunt-exec is not doing these kind of things.

Any thoughts?

sindresorhus commented 7 years ago

You want the preferLocal option.

soundstep commented 7 years ago

Oh the option is already there, thanks for pointing it out! Cheers.