This repository was archived by the owner on May 4, 2024. It is now read-only.
Closed
Conversation
`gauge` on the other hand, sets its default based on the TTYness of what it's writing to. We need to set this explicitly so that the two are in sync.
Update gauge to get isEnabled, so we can directly introspect what guage thinks about itself.
While we're initializing gauge with a constant now, this helps future proof us should we ever change that decision. It ensures that our own tracking variable is in sync with gauge from the start.
We were calling it after enabling and before disabling respectively but this is unnecessary as `gauge` will take care of these for us.
This means calling `gauge.disable()` when pausing if progressEnabled to ensure that the progress bar is cleared and won't be written to the screen while the log is disabled. And similarly calling `gauge.enable()` when resuming if progressEnabled. And finally patching `log.enableProgress()` to ONLY skip calling `gauge.enable()` when called while paused.
|
We have recently run into this in node-sass also |
Contributor
Author
|
This landed in 4.0.1 |
iarna
added a commit
to npm/npm
that referenced
this pull request
Nov 17, 2016
Fix bugs where `log.progressEnabled` got out of sync with how `gauge` kept track of these things resulting in a progressbar that couldn't be disabled. Fixes: #14413 PR-URL: npm/npmlog#46 Credit: @iarna
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
They were a result of
log.progressEnabledgetting out of sync withgauge's own internal ideas about its enabledness.