Skip to content

[Bug] runnning commands are not logged and error is not shown properly #1215

@regevbr

Description

@regevbr
  • I'd be willing to implement a fix

Describe the bug

Running scripts (using yarn run) does not log the actual commands that run, nor shows failures when they fail.
This makes debugging very hard when running a script that runs multiple commands (using nested yarn run) and one of them fails...

Yarn 1 implemented the logging perfectly

To Reproduce

Create a project with the following scripts:

{
    "foo": "exit 0",
    "foo1": "exit 1",
    "foo2": "yarn run foo && yarn run foo1"
}

and run yarn run foo2

the output (or the lack of it) is

> yarn run foo2
> echo $?
1

But in yarn 1 the output is very clear - it outputs each command it is about to execute, and a proper error when it fails

>yarn run foo2
yarn run v1.22.4
$ yarn run foo && yarn run foo1
$ exit 0
$ exit 1
error Command failed with exit code 1.

Environment if relevant (please complete the following information):

  • OS: Linux
  • Node version 12
  • Yarn version: 2.0.0-rc.31

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingnot a bugstaleIssues that didn't get attention

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions