shelljs / shx

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

fix: use process.exitCode to wait for streams #123

Closed nfischer closed 6 years ago

nfischer commented 6 years ago

Issue #85 Fixes #116

This is a follow-up to the initial PR. This favors process.exitCode over process.exit() to guarantee that we don't terminate while streams are still open.

This should have no effect on behavior, this is just a cleaner fix over the previous hack.

Test: manually verify with shx cat input.txt | wc (input.txt is Lorem ipsum)

nfischer commented 6 years ago

@freitagbr I got my lorem ipsum from https://www.lipsum.com/ (it maxes out at 10k words, but that's enough to repro the bug when reverting the original fix).

codecov-io commented 6 years ago

Codecov Report

Merging #123 into master will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff          @@
##           master   #123   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           3      3           
  Lines          22     22           
=====================================
  Hits           22     22

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update bc803b7...4a04057. Read the comment docs.

nfischer commented 6 years ago

@freitagbr ping