nvm
nvm copied to clipboard
Disable colors when stdout is not a terminal.
Fixes #2497
Can someone review this … ?
It looks good, but there's a bunch of tests failing.
Failure on WSL is a failure from action itself.
Failure on travis is quite interesting. But I didn't changed any core codes. I just used --no-colors arguments ( forcibly set if stdout is not a terminal ). I think travis must fail too ( when using --no-colors )
Edit: some errors are confusing ... What's *
'nvm alias default did not return 'default -> 0.10.1 (-> v0.10.1)', got 'default -> 0.10.1 (-> v0.10.1 *)'
Edit: tested on local machine
@ljharb, I think ... travis use | to capture stdout. But using pipe cause stdout is not a terminal. So that, output has *.
It's the same with original nvm using --no-colors. I think we need to update travis scripts Or we'll have to use another method to disable colors.

When colors are disabled, nvm uses symbols, instead of colors, to convey information.
In other words, there may be tests that are expecting the color output, and this change means those tests need to be updated.
Correcciones nvm-sh/nvm
All the "fast" and "sourcing" tests are failing.
Fixes nvm-sh/nvm#2497