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

only enable when this.stream.clearLine is available #9

Closed
dylang opened this issue Apr 5, 2016 · 3 comments
Closed

only enable when this.stream.clearLine is available #9

dylang opened this issue Apr 5, 2016 · 3 comments

Comments

@dylang
Copy link

dylang commented Apr 5, 2016

Issue

When spawning a command that uses ora, stream.clearLine isn't available. This causes ora to throw an exception when it runs this.stream.clearLine();.

I'm guessing there are other times clearLine may not be available.

Possible solution

The enable check could include checking that this.stream.clearLine is a function, or maybe this.stream.isTTY is true.

@sindresorhus
Copy link
Owner

Weird. It's already checking this.stream.isTTY before using clearLine.

ora/index.js

Line 37 in ca4e8ea

this.enabled = (this.stream && this.stream.isTTY) && !process.env.CI;

@dylang
Copy link
Author

dylang commented Apr 5, 2016

My own bug!

I am setting spinner.enabled every time I use it and not respecting if it's possible to be enabled.

Thanks for taking a look at this issue and hope I didn't take too much of your time.

@dylang dylang closed this as completed Apr 5, 2016
@sindresorhus
Copy link
Owner

No worries at all. You always provide really good bug reports :)

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

No branches or pull requests

2 participants