-
-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add option to display the diff in color (use global installed colordiff) #10
Conversation
Hey @juliangruber , Do you think we can merge this ? Thanks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excuse the late response 👋
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking a lot better! Just one question: This breaks if people with colordiff installed pipe into less
, right? As they'd need less -R
. Can we disable colordiff
if this command isn't executed in a tty
?
Hi @juliangruber, I have added a condition to check if it is running in a terminal or not (right in the same place it checks if colordiff is installed), so if it is not running in a terminal, it does not pipe colordiff. Please let me know if you need any other change or if you have any question/comment. Thank you ! |
Awesome! Thanks a lot for being patient, that's a sweet improvement |
Great ! 🎆 Thank you for your patient and time to review the PR and suggest improvements ! Hope people enjoy it ! |
Hi @juliangruber, Sorry to bother, but did you get time to publish the new version to npm ? Thank you ! |
Forgot about it, done, thanks for the reminder 🙌 https://github.com/juliangruber/npm-diff/releases/tag/v2.0.0 |
Hi !
I have added an option to inform a parameter when calling npm-diff so the output is colored. Internally it will check it
colordiff
is installed and if so, pipe the npm-diff result to colordiff. If colordiff is not installed, it will give an error (so it gets easier to user identify that it miss a dependency). If the option is not informed, it behaves as before (no color output)This is exactly the behavior suggested in the README but easier to be accomplished as you just need to add an
-c
option in the execution, like this:npm-diff -c intersect 0.0.0 0.1.0
Please let me know if you think this could be useful or not and if you have any question / suggestion !
Thank you !