difftastic icon indicating copy to clipboard operation
difftastic copied to clipboard

Returning error code is always 0

Open acamargo opened this issue 3 years ago • 0 comments

First of all, thanks for your work. Amazing tool!

Test scenario

Given two files When they have differences Then exits with error code 1

Output sample

$ cat v1.clj
(fn-1 arg1)

$ cat v2.clj
(fn-2 arg1)

$ cat v3.clj
(fn-1 arg1)

$ diff v1.clj v2.clj
1c1
< (fn-1 arg1)
---
> (fn-2 arg1)

$ echo $?
1

$ difft v1.clj v2.clj
v2.clj --- Clojure
1 (fn-1 arg1)                                                                                                         1 (fn-2 arg1)


$ echo $?
0

$ diff v1.clj v3.clj

$ echo $?
0

$ difft v1.clj v3.clj
v3.clj --- Clojure
No changes.


$ echo $?
0

I expected the same exit code as diff

Environment

$ difft --version
Difftastic 0.28.0

$ sw_vers
ProductName:	macOS
ProductVersion:	12.3
BuildVersion:	21E230

$ echo $0
-bash

acamargo avatar May 12 '22 22:05 acamargo