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

uvu --no-color has no effect #225

Open
kizdolf opened this issue Dec 14, 2022 · 0 comments · May be fixed by #226
Open

uvu --no-color has no effect #225

kizdolf opened this issue Dec 14, 2022 · 0 comments · May be fixed by #226

Comments

@kizdolf
Copy link

kizdolf commented Dec 14, 2022

The cli arguments defines -c, --color Print colorized output (default true), allowing the option --no-color to disable output colorization.

But using it has no effect.

This is due to two things:

option is never checked for false

The option set process.env.FORCE_COLOR = '1' when true (the default) but is never set to something else.
See: https://github.com/lukeed/uvu/blob/master/bin.js#L22
Since the default is true I propose

if (opts.color) process.env.FORCE_COLOR = '1';
else process.env.FORCE_COLOR = '0';

process.env.FORCE_COLOR is never checked.

colorization is done using kleur in https://github.com/lukeed/uvu/blob/master/src/diff.js
but it does not check for process.env.FORCE_COLOR

kleur has a enabled option, which could be usefull:

if(process.env.FORCE_COLOR === '0') kleur.enabled = false

I've open #226 to fix this

@kizdolf kizdolf linked a pull request Dec 14, 2022 that will close this issue
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 a pull request may close this issue.

1 participant