The current workaround for the EPIPE error on Darwin, when running . <(npm completion), does not work because the errno that comes back from Node is actually a string, rather than the numeric error code it's being compared against. This patch fixes that test.
. <(npm completion)
With the test fixed, there's another error, because we call our callback twice. The first time is when we get called back from write(), and the second when we process the EPIPE error. Thus the patch includes code to ensure that we only call our callback once.
Fix EPIPE workaround for Darwin
Landed on 5effe86. Thanks!