shelljs / shx

Portable Shell Commands for Node
MIT License
1.72k stars 44 forks source link

fix: don't exit until all output is flushed #86

Closed nfischer closed 7 years ago

nfischer commented 7 years ago

Shx previously suffered from a race condition where it could exit the process before stdout is fully written (especially so for lots of output). Now process termination is deferred until all streams end.

Fixes #85

The real fix for this is all inside cli.js. Most of this PR is refactoring our test setup to be compatible with the change. This should not change the individual tests themselves, however.

codecov-io commented 7 years ago

Current coverage is 89.28% (diff: 100%)

Merging #86 into master will not change coverage

@@             master        #86   diff @@
==========================================
  Files             2          2          
  Lines            28         28          
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
  Hits             25         25          
  Misses            3          3          
  Partials          0          0          

Powered by Codecov. Last update 70642a2...b08a5d7

nfischer commented 7 years ago

Hmmm... it appears this always exits with status 0, so don't merge this yet. I'll look into this and see if I can resolve the issue.

nfischer commented 7 years ago

Ok, error codes should work properly now

ariporad commented 7 years ago

LGTM!