-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Spinner crashes CI build because process.stdout.columns === 0
#607
Comments
Zx should disable spinner in its not tty. |
That is perhaps true, but as mentioned in the ticket, it is being run in a pseudo-TTY supplied by |
So a check for column is number needed |
I suppose that it always will be through some sanity checks / defaults behavior of node, but it will be |
i disabled the spinner in CI: import { spinner as googleSpinner } from 'zx'
export async function spinner<T>(fn: () => Promise<T>): Promise<T> {
if (process.env.CI === 'true') {
return fn()
}
return googleSpinner(fn)
} @antonmedv is someone interested to add this functionality to |
I think yes. |
Expected Behavior
spinner
shouldn't throw errorsActual Behavior
the offending code:
Apparently, the
process.stdout.columns
is0
when running in GitLab CI through the NIX script runner & thescript
utility.I don't know which part of the stack causes the
columns
value to be 0, but I supposescript
would be the best bet.I'm using this to force NIX to preserve colors, of my build scripts.
To fix this, I'D propose to
Math.max
the computed repetition value to0
at https://github.com/google/zx/blob/main/src/goods.ts#L201Specifications
The text was updated successfully, but these errors were encountered: