Skip to content
This repository was archived by the owner on Apr 30, 2020. It is now read-only.

flynt install fails if it a TTY is not allocated #92

@rodrigoaguilera

Description

@rodrigoaguilera

First of all. Great project and thanks for contributing it to the community :)

I have been trying to setup a gitlab CI pipeline that builds a flynt project and I after many hours of hitting my head against cryptic errors I realized that TTY needs to be allocated for flynt-cli to work properly.

In my local terminal everything runs alright but when I try to run a flynt install the CI will fail as soon as it tries to print updates to the process to the terminal output
An example:

▶ Saving config...                                                                                                                                                          
✔ Saving config...                                                                                                                                                          
▶ Installing node dependencies...  
 [Installs yarn dependencies]
Done in 19.34s.                                                                                                                                                             
                                                                                                                                                                            

but when it needs to output "✔ Installing node dependencies... " the build fails. (the terminal without tty won't actually output those 3 first lines but I explain it like this to illustrate the flow)

I can reproduce this locally by running:

docker run --rm netzstrategen/wp-flynt sh -c "flynt install"

while running:

docker run -it --rm netzstrategen/wp-flynt sh -c "flynt install"

runs successfully. Notice the -it

I think it may be caused by some package like ora
https://www.npmjs.com/package/ora

Quoting the readme

isEnabled

Type: boolean

Force enable/disable the spinner. If not specified, the spinner will be enabled if the stream is being run inside a TTY context (not spawned or piped) and/or not in a CI environment.

Maybe flynt should detect if it is running inside a TTY and adjust properly.

Can you give more hints about what is happening?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions