thoughtbot / cocaine

A small library for doing (command) lines.
https://robots.thoughtbot.com
Other
785 stars 55 forks source link

Fix swallow_stderr for windows/cygwin shells #14

Closed petemounce closed 12 years ago

petemounce commented 12 years ago

The unix? method didn't support windows/cygwin shells. By making the test include looking for the SHELL environment variable, support is added (windows environment doesn't set this, so echo %SHELL% in a cmd.exe returns nil). Thanks http://www.cyberciti.biz/tips/how-do-i-find-out-what-shell-im-using.html .

Also, I think the bit_bucket should be &2>/dev/null for unix shells - without that, in windows/cygwin, I get a path-not-found, anyway. I assume that's the same for real unix shells.

jyurek commented 12 years ago

Honestly, I'm surprised by this. Cygwin is supposed to be using a stock bash shell. Why would its file redirection be different? Also, what does RbConfig::CONFIG['host_os'] return on Cygwin if not something that matches /mswin|mingw/?

mike-burns commented 12 years ago

Do the tests fail on Cygwin?

mike-burns commented 12 years ago

Closing this due to inactivity.

Thanks, -Mike