josephburnett / jd

JSON diff and patch
MIT License
826 stars 38 forks source link

use non-zero exit code if differences are found #33

Closed nicki-krizek closed 2 years ago

nicki-krizek commented 2 years ago

Currently, jd always returns exit code 0 if the tools succeeds, regardless of whether it detects any difference or not.

I propose that a non-zero exit code is returned if the tool finds a difference. This would make jd much easier to use in scripts (automation, CI, etc.).

There is already a precedent for such behavior, e.g. diff tool returns exit 1 if differences are found, 0 if not.