rtfpessoa / diff2html-cli

Pretty diff to html javascript cli (diff2html-cli)
https://diff2html.xyz
MIT License
521 stars 50 forks source link

'--renderNothingWhenEmpty' didn't work when using 'stdin' as input #141

Closed Ps7ch3 closed 1 year ago

Ps7ch3 commented 2 years ago
$ echo "123" > /tmp/test

$ diff -u /tmp/test /tmp/test | diff2html --renderNothingWhenEmpty -i stdin -s side -F diff.html 
The input is empty. Try again. []
Usage: diff2html [options] -- [diff args]

Options:
  -s, --style                            Output style
                                     [choices: "line", "side"] [default: "line"]
      --fileContentToggle, --fct         Show viewed checkbox to toggle file
...
...
...

I wonder if there is a way to get the display content like in this issue when using 'stdin' as input source

rtfpessoa commented 2 years ago

👋 @Ps7ch3 this option is not exactly for this case. It just works when you have a diff but it has no chunks.

In your case you have no diff, literally no content.

This could be tweaked I guess.

It would be fine for me to allow this flag to not fail if content is empty.

Feel free to send a PR