Skip to content
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

Merged
merged 1 commit into from
Aug 9, 2021

Conversation

trystan2k
Copy link
Contributor

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 !

@trystan2k
Copy link
Contributor Author

Hey @juliangruber ,

Do you think we can merge this ?

Thanks

Copy link
Owner

@juliangruber juliangruber left a 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 👋

History.md Outdated Show resolved Hide resolved
npm-diff Outdated Show resolved Hide resolved
npm-diff Outdated Show resolved Hide resolved
npm-diff Show resolved Hide resolved
Copy link
Owner

@juliangruber juliangruber left a 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?

README.md Outdated Show resolved Hide resolved
@trystan2k
Copy link
Contributor Author

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 !

@juliangruber juliangruber merged commit caa2a60 into juliangruber:master Aug 9, 2021
@juliangruber
Copy link
Owner

Awesome! Thanks a lot for being patient, that's a sweet improvement

@trystan2k
Copy link
Contributor Author

Great ! 🎆

Thank you for your patient and time to review the PR and suggest improvements ! Hope people enjoy it !

@trystan2k
Copy link
Contributor Author

Hi @juliangruber,

Sorry to bother, but did you get time to publish the new version to npm ?

Thank you !

@juliangruber
Copy link
Owner

Forgot about it, done, thanks for the reminder 🙌

https://github.com/juliangruber/npm-diff/releases/tag/v2.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants