Skip to content

Git Bash windows arguments are incorrectly escaped #8000

Open
@devversion

Description

@devversion

Bug description

Command

yarn run bazelisk query 'kind("rule_1|rule_2")'

What is the current behavior?

Yarn uses puka for shell quoting. puka seems to convert the arguments to
the following string:

console.log(puka.sh`query 'kind("pkg_npm|ng_package")'`);
query ^"kind^(\^"pkg_npm^|ng_package\^"^)^"

This causes Git Bash to break (when used as as shell), because caret cannot be used for
escaping. It will only work if the command is spawned in plain cmd where caret can escape.

What is the expected behavior?

The command should work as expected without yarn run.

e.g. running `./node_modules/.bin/bazelisk query 'kind("rule_1|rule_2")' works.

Steps to Reproduce

  1. Create an empty project
  2. Add @bazel/bazelisk as dependency
  3. Run the command shared above (on a Windows machine in Git Bash)
  4. Verify that it works expected if the command is run outside of Yarn

Environment

  • Node Version: 12.13.0
  • Yarn v1 Version: 1.12.1
  • OS and version: Windows 10

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