Skip to content
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

Git Bash windows arguments are incorrectly escaped #8000

Open
devversion opened this issue Mar 18, 2020 · 0 comments
Open

Git Bash windows arguments are incorrectly escaped #8000

devversion opened this issue Mar 18, 2020 · 0 comments

Comments

@devversion
Copy link

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant