Skip to content

When passing args to a script, when using yarn, extra "--" argument is added #920

Description

@dobesv

Describe the bug

Unlike with npm, when using yarn to run scripts, it is not necessary to pass -- to separate arguments to the script from the arguments to yarn itself. When doing so, the -- is passed through to the script unchanged. This can cause an issue if the script itself is not expecting to receive this argument.

Note that pnpm also does not require the -- so it appears that npm is currently a special case in this regard.

To Reproduce

Steps to reproduce the behavior:

  1. Create a script in package.json that does something with its arguments, e.g. "test": "echo args:"
  2. Run that script via lage, with arguments, using yarn as the script runner
  3. Notice whether -- is provided as an argument to the script

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions