kachkaev / suppress-exit-code

Cross-platform CLI wrapper that runs any command and exits with zero

Home Page:https://www.npmjs.com/package/suppress-exit-code

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

suppress-exit-code

Cross-platform CLI wrapper that runs any command and exits with zero

npm

## exits with non-zero
crazy-broken-command --some-arg=42

## exits with zero, stdout and stderr streams are kept as is
suppress-exit-code crazy-broken-command --some-arg=42

Motivation: lint-staged/lint-staged#616

Installation

Local

npm install --dev suppress-exit-code
## or
yarn add --dev suppress-exit-code
## or
pnpm add --dev suppress-exit-code

Global

npm install --global suppress-exit-code
## or
yarn global add suppress-exit-code
## or
pnpm add --global suppress-exit-code

Possible improvements

Feel free to contribute with a PR if you need these extra features (they are possible, but are not implemented yet):

## keep exit code unless it matches a given whitelist
suppress-exit-code --only=1,2,3 crazy-broken-command --some-arg=42
## make sure nothing is ever printed to the standard error stream
## (helps when running a subcommand in sensible environments)
suppress-exit-code --stderr=pipe-to-stdout crazy-broken-command --some-arg=42
suppress-exit-code --stderr=suppress crazy-broken-command --some-arg=42

About

Cross-platform CLI wrapper that runs any command and exits with zero

https://www.npmjs.com/package/suppress-exit-code


Languages

Language:JavaScript 86.2%Language:Shell 13.8%