We are currently shelling out to the grep command for some
functionality of the pre-commit gem. In order to do this we need to
reason about the grep executable running on the system.
To introspect the command we check the output of the grep --version
command and decide what to do next. On Alpine Linux grep does not
report its version and instead outputs an error message. Here we
ignore the standard error stream when checking grep's version.
Coverage increased (+0.007%) to 97.326% when pulling c2d09b6807bd041749c9f87adfe4c6faa8aaa28f on grep-version into ec99266a8828d7cb2feea806048681e9e870dda9 on master.
We are currently shelling out to the
grep
command for some functionality of the pre-commit gem. In order to do this we need to reason about thegrep
executable running on the system.To introspect the command we check the output of the
grep --version
command and decide what to do next. On Alpine Linux grep does not report its version and instead outputs an error message. Here we ignore the standard error stream when checking grep's version.fixes #265 @fgrehm